Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks for the link to the cron discussion. Although maybe your problem seems a little different to mine. It appears you can't get the actual command he wants to execute to work correctly? I can get rsync to work just fine when executing it from the command line. What I can't get is for crontab to execute it.
Maybe your rsync command is not under /usr/bin and cron cannot locate it, since cron has a very limited PATH (different from the PATH you have on the command line). You can try to put the absolute path to rsync, when invoking from the script. Also, have you received some message onto the system mail for root? Usually it is the place where standard output and standard error are sent, if not explicitly redirected somewhere else. Furthermore you can check if the cron job is properly executed adding a simple command to your script, as
I can confirm that rsync is located under /user/bin
After reading root's mail, I can see lots of errors! But of course I have no idea what they mean. I also don't understand why when I execute rsync manually from the command line it works, but not as part of crontab.
Here's the mail output from the most recent crontab attempt:
I can confirm that rsync is located under /user/bin
After reading root's mail, I can see lots of errors! But of course I have no idea what they mean. I also don't understand why when I execute rsync manually from the command line it works, but not as part of crontab.
Here's the mail output from the most recent crontab attempt:
rsync: symlink "/mnt/s3/kmtv/scottish" -> "/home/scottish/" failed: No such fil$
rsync: recv_generator: mkdir "/mnt/s3/kmtv/admin" failed: No such file or direc$
*** Skipping everything below this failed directory ***
<snip - lots more similar type failures for each directory>
rsync: recv_generator: mkdir "/mnt/s3/kmtv/test" failed: No such file or direct$
*** Skipping everything below this failed directory ***
rsync: open "/mnt/s3/kmtv/.htaccess" failed: No such file or directory (2)
rsync: open "/mnt/s3/kmtv/empty.mov" failed: No such file or directory (2)
<snip lots more similar type failures for each file>
rsync: open "/mnt/s3/kmtv/sitemap.xml" failed: No such file or directory (2)
rsync: open "/mnt/s3/kmtv/update_rss.php" failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at main.c(977) [send$
<snip lots more similar type failures for each file>
rsync: open "/mnt/s3/kmtv/kmtv_user_agents.frm" failed: No such file or directo$
rsync error: some files could not be transferred (code 23) at main.c(977) [send$
rsync: writefd_unbuffered failed to write 227 bytes [sender]: Broken pipe (32)
rsync: write failed on "/mnt/s3/scottish/jos_content.MYD": Input/output error ($
rsync error: error in file IO (code 11) at receiver.c(259) [receiver=2.6.9]
rsync: connection unexpectedly closed (1692 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [genera$
rsync: connection unexpectedly closed (696 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [sender$
/usr/bin:/bin /root/testfile
An earlier cron job from 8am this morning had slightly different errors. They are shown below:
Quote:
rsync error: some files could not be transferred (code 23) at main.c(977) [send$
rsync: recv_generator: mkdir "/mnt/s3/kmtv" failed: Device or resource busy (16)
*** Skipping everything below this failed directory ***
rsync error: some files could not be transferred (code 23) at main.c(977) [send$
rsync: writefd_unbuffered failed to write 313 bytes [sender]: Broken pipe (32)
rsync: write failed on "/mnt/s3/scottish/jos_content.MYD": Input/output error ($
rsync error: error in file IO (code 11) at receiver.c(259) [receiver=2.6.9]
rsync: connection unexpectedly closed (1692 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [genera$
rsync: connection unexpectedly closed (674 bytes received so far) [sender]
$sender$
I don't really understand why it works from command line and not from crontab, but from your test is evident that there was a failure when copying symbolic and/or hard links. The archive mode (option -a) tries to preserve a lot of stuff including symbolic links and the first entry in the error log is just related to the creation of a symbolic link
Quote:
rsync: symlink "/mnt/s3/kmtv/scottish" -> "/home/scottish/" failed: No such file or directory.
To debug you can try to explicitly pass the options related to the archive mode and remove them one at a time, starting from -l. To see which are these options, check rsync --help and you will get something like
Code:
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
Also, you may consider to use the option --copy-links instead, if it is suitable for your needs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.