# Crontab



## Sylhouette (Nov 30, 2012)

Hello all

I have one simple question, and I am really embarrassed :r

How to run a script from crontab 5 minutes past the hour. I am running a zfs pool and I use zfs-periodic to create the snapshots every hour, this works wonders. But I want to send them over after the snapshots are taken. If I use the hourly method, but then sometimes the zfs send script starts before the snapshots have been done, so I want it to start every hour but 5 or maybe even one minute after the hour.

thanks for your time
regards


----------



## SirDice (Nov 30, 2012)

That's actually really easy:

```
# Minutes      hour    mday   month    wday    command
 5              *       *       *       *        /some/command
```

The 5 minutes tells it to run when the clock shows 5 minutes, everything else is a wildcard so it runs every weekday (wday) of every month on every day of the month (mday) and every hour.


----------



## walko (Nov 30, 2012)

That would work if you use your own crontab (crontab -e), otherwise you shoud add the user which will run the command :



```
# Minutes      hour    mday   month    wday  user  command
 5              *       *       *       *    toto   /some/command
```


----------



## SirDice (Nov 30, 2012)

walko said:
			
		

> That would work if you use your own crontab (crontab -e)


Which you should do. Even for root.


----------



## Sylhouette (Nov 30, 2012)

Shame on me, I used */5 in the minute field which did run it every 5 minutes.

Sometimes you tend to think much more complicated that things are.

thanks!

BTW i always use crontab -e to add jobs to the crontab even as root.

gr
johan


----------

