Crontab

From MTU LUG Wiki
Revision as of 07:52, 14 April 2022 by imported>Sjwhitak (Created page with "You run a command: {{UserCmd|rsync -r folder/ user@backup.server.lan:~/}} You want to run this every day at 2am: {{UserCmd|crontab -e}} <syntaxhighlight lang="crontab"> 0 2 * * * rsync -r folder/ user@backup.server:~/ </syntaxhighlight> Use [https://crontab.pro/ crontab.pro] to map out crontab times. In any case, crontab will run any command you want. You want a series of commands to be run at once? Wrap it in a bash script. You want to run multiple commands?...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You run a command:

user $rsync -r folder/ user@backup.server.lan:~/

You want to run this every day at 2am:

user $crontab -e
0 2 * * * rsync -r folder/ user@backup.server:~/

Use crontab.pro to map out crontab times.

In any case, crontab will run any command you want.

You want a series of commands to be run at once? Wrap it in a bash script.

You want to run multiple commands?

user $crontab -e
0 1 * * * python sync.py
0 2 * * * rsync -r folder/ user@backup.server:~/