Sample Header Ad - 728x90

crontab to make distant backup

0 votes
1 answer
41 views
I'm trying to backup my project, databases & nginx environnement. For that, I'm doing backup from my main server and place it in /home/backup/. Everything work on the main server. Then, from my second server, I'm creating a cron to get that files through SCP. Here is my command : 0 13 * * * sudo sshpass -p MyPassword sudo scp -P 40511 -r user@mydomain.com:/home/backup /home I'm using port 40511 as SSH. The command works if launched manually, but doesn't work with cron. MyPassword contain an "!". I tried with and without double-quote. What am I doing wrong ?
Asked by P. Jerome (123 rep)
Jan 20, 2025, 11:29 AM
Last activity: Jan 20, 2025, 03:47 PM