Running under user account, use crontab -e to edit your user's crontab
crontab -e
Create a new entry in the crontab file:
| | | | | |
| | | | | +-- Year (range: 1900-3000)
| | | | +---- Day of the Week (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month (range: 1-31)
| +---------- Hour (range: 0-23)
+------------ Minute (range: 0-59)
- The template above represents the fields you can enter into the crontab file. Think of each field as an entry followed by a space to separate fields.
For instance,
00 1 * * 1 * echo "hello!" >> ~/hello
would execute the command 'echo "hello!" >> ~/hello' every Monday at 1:00AM.
An asterisk represents an unused field, equivalent to N/A.
Make sure whatever command you're using has permission to modify the files/folders you want to modify.
- Save the crontab file after you're done editing and it will run at the next instance.