I want hestiaCP to retain a weekly and/or monthly backup in case a web site vanishes and it takes me more than a day to do anything about it.
I first wanted to add a (hestia admin) CRON job to do an ‘extra’ sudo /usr/local/hestia/bin/v-backup-user but since I do not see a way to specify a[n alternate] file name, that would probably simply overwrite the daily backup and itself be overwritten the following day.
So I decided to add a CRON job to simply copy that user’s (hopefully one and only) .tar to one with a different name on a weekly/monthly basis so it would not be overwritten every day. What I added was sudo cp /backup/userid.???-??-??_??-??-??.tar /backup/userid-monthly.tar (4 ?s show up here as 3?!), BUT when I refresh the hestiaCP list of CRON jobs, all my "?"s have been replaced with the digits in the current/existing .tar in /backups!
I decided to instead try
sudo cp /backup/userid*.tar /backup/backup/userid-monthly.tar
but when I refreshed hestia’s list of CRON jobs, the /backup/backup change was retained but the change to an asterisk (instead of all the parsed/changed "?"s) was IGNORED!!!
hestiaCP is apparently working way too hard trying (and clearly failing) to parse the command. (seems like it would already support weekly/monthly backup backups if it simply just left my cp command alone!)
Even after using double-quotes to get my cp command, with standard *nix wildcard characters, entered into hestiaCP’s admin’s list of CRON jobs, it did not work.
So MY SOLUTION was to root mkdir /backup/backup and edit /etc/crontab to include a line that says 25 5 1 * * root cp /backup/userid*.tar /backup/backup/userid-monthly.tar 35 5 1 * * root chown admin:userid /backup/backup/userid-monthly.tar
and now, on the 1st of every month, 15 minutes after making the daily backup, linux will stash a copy of that userid’s.tar file (I’m only keeping 1 daily backup) away in /backup/backup, overwriting the prev month’s stashed copy.
The 2nd line could make it easier to later access the stashed file, to rename/move it to where it could be restored via hestiaCP.
PS: add -p to 1st line (“cp -p”) then 2nd line not needed