Dear All,
Need your valuable favor / help. Thanks well in advance.
I have created rsync auto backup script for LAN Backup. It is not working. If I run manually it is working. So can you please guide me to solve my issue.
rsync backup script: stored in /root/backup.sh
#!/bin/bash
/usr/bin/rsync -aAXv -e ssh /home/prod1/Desktop/ Administrator@192.168.10.110:/media/Administrator/Backup/LAXMI/Backup/Production1/Desktop/
/usr/bin/rsync -aAXv -e ssh /home/prod1/Documents/ Administrator@192.168.10.110:/media/Administrator/Backup/LAXMI/Backup/Production1/Documents/
crontab -e
* * * * * /bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1
grep CRON /var/log/syslog
May 28 19:56:01 production1 CRON[3982]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 19:57:01 production1 CRON[3986]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 19:58:01 production1 CRON[3989]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 19:59:01 production1 CRON[3993]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:00:01 production1 CRON[3996]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:01:01 production1 CRON[3999]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:02:01 production1 CRON[4003]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:03:01 production1 CRON[4006]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:04:01 production1 CRON[4010]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:05:01 production1 CRON[4013]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:06:01 production1 CRON[4016]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:07:01 production1 CRON[4020]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:08:01 production1 CRON[4023]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:09:01 production1 CRON[4027]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:10:01 production1 CRON[4030]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:11:01 production1 CRON[4033]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
May 28 20:12:01 production1 CRON[4042]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
Same script if I do it with below command (manually) it is working.
sh /root/backup.sh working perfectly.
am I making any mistake anywhere? Please guide me.
Once again Thank you.
Lokesh Kamath
RSYNC Backup with SSH
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
RSYNC Backup with SSH
Last edited by LockBot on Tue Nov 28, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: RSYNC Backup with SSH
Thanks for your response..
Sorry.
So I have to change it to sh /root/backup.sh?
Lokesh Kamath
Sorry.
So I have to change it to sh /root/backup.sh?
Lokesh Kamath
Re: RSYNC Backup with SSH
You should reconsider NOT using the >/dev/null syntax. You need to review the backup.log for errors instead of redirecting it to /dev/null. The following crontab entry will be more helpful.lokesh wrote: ⤴Sun May 28, 2023 10:48 am ...
crontab -e
* * * * * /bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1
grep CRON /var/log/syslog
May 28 19:56:01 production1 CRON[3982]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1)
...
May 28 20:12:01 production1 CRON[4042]: (root) CMD (/bin/bash/ /root/backup.sh >> backup.log >/dev/null 2>&1
...
Code: Select all
* * * * * /root/backup.sh >> backup.log 2>&1
🐧Linux Mint 20.3 XFCE (UEFI - Secure Boot Enabled) dual boot with Windows 11
Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️
Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️
Re: RSYNC Backup with SSH
Thanks for your response.
Noted. I will correct it.
Thanks
Lokesh Kamath
Noted. I will correct it.
Thanks
Lokesh Kamath