1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 2084
/ 2 Years ago, sun, october 30, 2022, 12:37:41
I would like to create backup from directory using cron. I wrote following command:
cd path && sudo zip -r "backup-$(date +"%Y-%m-%d").zip" git/ && sudo mv "backup-$(date +"%Y-%m-%d").zip" /backup/
when I call it from commandline then everything is ok. But when I put it to cron then it does not work. Log contains only part of this command and nothing more. What shall I do?
Crontab content:
* * * * * cd path && zip -r "backup-$(date +"%Y-%m-%d").zip" git/ && mv "backup-$(date +"%Y-%m-%d").zip" /backup
/
More From » bash