Quote:
Originally Posted by SimonTHK
|
No, don't take that action yet -- you haven't taken the advice of the other posters yet. Someone earlier in this thread told you to provide complete paths for your commands, but you didn't do it. Here is your original command:
Code:
* * * * * sudo rsync -azvv /home/simonthk/Folder1/ /home/simonthk/Folder2
1. You cannot use "sudo" in a cron job. Sudo doesn't work without a TTY. By default, cron is executed as root, so it serves no purpose in any case.
2. You have to provide full paths for
everything:
Code:
* * * * * /usr/bin/rsync -azvv /home/simonthk/Folder1/ /home/simonthk/Folder2
3. Are you sure you want to put this much detail in the cron file? Why not execute a script that contains the actual details? Be sure to provide a full path to the script.
4. Are you sure you want to run this every minute? The danger is that when there is a lot of data to move, multiple cron jobs will overlap, which could destroy your data.
5. Only use -v options to rsync in cron if you want to get an e-mail every minute of the day and night. With -v options, rsync emits lots of text, and this is routed as e-mails to the owner of the process, e.g. root. To avoid this problem, dump the resulting text like this:
Code:
* * * * * /usr/bin/rsync -azvv /home/simonthk/Folder1/ /home/simonthk/Folder2 > /dev/null 2>&1
But only do this once you're sure it's working -- it hides any number of informative error messages.