LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-06-2009, 11:50 AM   #16
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102

Quote:
Originally Posted by SimonTHK View Post
someone complaining about crontab in ubuntu, maybe I should try out debian :/

http://www.siriusventures.com/why-i-...b-not-enabled/

cause the problems seems very similar
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.
 
Old 10-07-2009, 03:09 AM   #17
SimonTHK
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lutusp View Post
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.
I DID try with full path it does show that it should be a cron job, but it still doesnt run. I dont have much time now, but Ill work with it later
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync and cron numtre Linux - Software 1 01-08-2009 06:54 AM
Need coaching with RSync and cron configuration on Ubuntu mkenyon2 Linux - Software 4 12-17-2008 03:09 AM
Auto RSYNC Over SSH via Cron? carlosinfl Linux - General 1 09-10-2007 02:12 PM
Cannot execute rsync as a cron job jdaniels73 Linux - Software 2 09-03-2006 05:03 AM
using rsync with cron & pub. key kmitz Fedora 0 01-14-2005 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration