Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 19625  / 1 Year ago, wed, may 17, 2023, 5:15:46

Using this command in rsync:



rsync -azvh [email protected]:/media/PNY/video /home/john/Desktop/Pi Videos


Works flawlessly. Now, when I put this command in crontab to run every 15 minutes, it does not work and I am wondering if my command in crontab is correct?



*/15 * * * * rsync -avzhe ssh [email protected]:/media/PNY/video /home/john/Desktop/Pi Videos

More From » cron

 Answers
6

Wow, What a dig! I found the answer on linuxquestions.org



CLI and crontab run on different environments. Crontab needs to be told where the private key is. I followed the instructions on the link and simply added the location of private key on the command and it worked. The previous command now has this addition added.



*/15 * * * * rsync -avzhe "ssh -i /home/john/.ssh/id_rsa_dvr.pi" [email protected]:/media/PNY/video /home/john/Desktop/Pi Videos


Now on to find a doctor that can help get some of these roots put back in. :-)


[#18159] Friday, May 19, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
soahan

Total Points: 230
Total Questions: 123
Total Answers: 123

Location: Maldives
Member since Tue, Dec 21, 2021
2 Years ago
;