Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Posts
    268

    Did i do something wrong for my cron job ?

    Hi guys,

    I setup cron job for my rsync from server 192.168.1.10 to 192.168.1.15 to do hourly. The rsync works fine, see below:

    Code:
    [[email protected] ~]$ rsync -r -e ssh /home/andyj/imap/mysite.com/andyj/* [email protected]:/home/andyj/imap/mysite.com/andyj
    [[email protected] ~]$
    Here how i setup my /etc/cron.hourly/rsyncbak.sh:
    Code:
    #!/bin/bash
    rsync -r -e ssh /home/andyj/imap/mysite.com/andyj/* [email protected]:/home/andyj/imap/mysite.com/andyj
    and chmod 755 rsyncbak.sh , but it doesn't work . any idea? Thanks

  2. #2
    Join Date
    Mar 2007
    Location
    Phoenix, AZ
    Posts
    132
    try using full path for rsync
    usuablly /usr/bin/rsync
    Cheers,
    Sivanandhan, P. (a.k.a. apsivam)
    My Blog Site

  3. #3
    Join Date
    Aug 2003
    Location
    Gods Own Country
    Posts
    869
    Try executing the script manually and paste the result here.
    ie sh /etc/cron.hourly/rsyncbak.sh

    I think from that output (error) we can come to a conclusion regarding the issue.
    Blessen Cherian
    Follow me on twitter.com/blessenonly
    Over a decade plus in the Hosting Industry

  4. #4
    Join Date
    Jan 2005
    Posts
    268
    Quote Originally Posted by blessen View Post
    Try executing the script manually and paste the result here.
    ie sh /etc/cron.hourly/rsyncbak.sh

    I think from that output (error) we can come to a conclusion regarding the issue.
    it's asking me for the password again.

    By the way, i put it in crontab instead, and it works just fine. thanks

  5. #5
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Quote Originally Posted by AndyJ View Post
    it's asking me for the password again.
    If this happens again, check the ssh-key file permissions inside .ssh folder and the remote user home directory permission. Rsync process may change the permission once it is run.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •