Hi I put the rsync in cronjob but it won't work in root user cron */30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1 1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe 2/ why this root cronjob is not working? what wrong? I can't see this cron in message the rsy.sh is below #! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html /backup/html Thank you
__________________________________________________________________ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now http://ca.toolbar.yahoo.com.
chloe K wrote:
Hi
I put the rsync in cronjob but it won't work
in root user cron
*/30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1
1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe
2/ why this root cronjob is not working? what wrong? I can't see this cron in message
the rsy.sh is below
#! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html mailto:chloe@remotehost:/var/www/html /backup/html
Thank you
Hi Chloe, As root the rsync has no access to your keys - run this job as yourself rather than root. HTH Rob
Ask a question on any topic and get answers from real people. *Go to Yahoo! Answers.* http://ca.answers.yahoo.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
I put it in chloe user cron but cron seems not running. why?
--- On Thu, 9/3/09, Rob Kampen rkampen@kampensonline.com wrote:
From: Rob Kampen rkampen@kampensonline.com Subject: Re: [CentOS] rsync To: "CentOS mailing list" centos@centos.org Received: Thursday, September 3, 2009, 4:10 PM
chloe K wrote:
Hi I put the rsync in cronjob but it won't work in root user cron */30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1 1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe 2/ why this root cronjob is not working? what wrong? I can't see this cron in message the rsy.sh is below #! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html mailto:chloe@remotehost:/var/www/html /backup/html Thank you
Hi Chloe, As root the rsync has no access to your keys - run this job as yourself rather than root. HTH Rob
Ask a question on any topic and get answers from real people. *Go to Yahoo! Answers.* http://ca.answers.yahoo.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-----Inline Attachment Follows-----
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
__________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr!
Does the script normally when your run it manually with the use of cron? Do you have the correct access permisions to the local directory and the script file? Have you looked in your console log? Try running it without sending the output to /dev/null to see if errors come up?
James ;)
-----BEGIN GEEK CODE BLOCK----- Version: 3.1 GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V- PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++ ------END GEEK CODE BLOCK------
I can run it properly manually
--- On Thu, 9/3/09, James Bensley jwbensley@gmail.com wrote:
From: James Bensley jwbensley@gmail.com Subject: Re: [CentOS] rsync To: "CentOS mailing list" centos@centos.org Received: Thursday, September 3, 2009, 4:23 PM
Does the script normally when your run it manually with the use of cron? Do you have the correct access permisions to the local directory and the script file? Have you looked in your console log? Try running it without sending the output to /dev/null to see if errors come up?
James ;)
-----BEGIN GEEK CODE BLOCK----- Version: 3.1 GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V- PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++ ------END GEEK CODE BLOCK------ _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
__________________________________________________________________ Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
Scott Silva wrote:
on 9-3-2009 1:36 PM chloe K spake the following:
I can run it properly manually
Also, cron doesn't always have access to your path or environment. You need to make sure that you give full paths to everything to be safe.
I got bitten by that so many times, now I just use absolute paths with cron every time. :-)
chloe K wrote:
Hi
I put the rsync in cronjob but it won't work
in root user cron
*/30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1
1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe
Assuming your key doesn't need a passphrase, authorized keys work because the remote side has the public part which is uses to make sure that the connecting process can read the private part - which, unless you say otherwise, is expected to be in $HOME/.ssh/
2/ why this root cronjob is not working? what wrong? I can't see this cron in message
the rsy.sh is below
#! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html mailto:chloe@remotehost:/var/www/html /backup/html
If it works when logged in as yourself, the right identity key is probably in your own $HOME/.ssh/ directory. If you gave a passphrase when you created the keys, then it is a bit more complicated.
check this out if you wish to do root based server backups or whatever
http://www.jms1.net/code/rsync-backup.shtml
- rh
Try this ... On your script ...
/usr/bin/rsync -avzh -e "ssh -i /home/user/.ssh/auth-key" chloe@remotehost:/var/www/html /backup/html
Gabe
On 9/3/09 4:06 PM, "chloe K" chloekcy2000@yahoo.ca wrote:
Hi
I put the rsync in cronjob but it won't work
in root user cron
*/30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1
1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe
2/ why this root cronjob is not working? what wrong? I can't see this cron in message
the rsy.sh is below
#! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html mailto:chloe@remotehost:/var/www/html /backup/html
Thank you
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. http://ca.answers.yahoo.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Gabriel Rosca wrote:
Try this ... On your script ...
/usr/bin/rsync -avzh -e "ssh -i /home/user/.ssh/auth-key" chloe@remotehost:/var/www/html /backup/html
You are correct about the -i switch.
Another possibility coming to me mind (if the machine the cronjob is running is not the local machine but remote per ssh): maybe chloe K is using Authentication forwarding (see the -A -a switches to ssh). If so, maybe the private key is only existing on the local machine but not on the machine the cronjob is running.
chloe K wrote:
Hi
I put the rsync in cronjob but it won't work
in root user cron
*/30 * * * * /home/chloe/rsy.sh >/dev/null 2>&1
1/ why it needs pw when I run this rsy.sh in root? but if I run it in chloe user, it doesn't need pw as I put authoized_key in remote host chloe
2/ why this root cronjob is not working? what wrong? I can't see this cron in message
the rsy.sh is below
#! /bin/sh rsync -essh -av chloe@remotehost:/var/www/html mailto:chloe@remotehost:/var/www/html /backup/html
Thank you
Ask a question on any topic and get answers from real people. *Go to Yahoo! Answers.* http://ca.answers.yahoo.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi Chloe,
How did you create your cron table? You have to craete it with crontab and not with vi for it to be effective.
ChrisG