Weekly or monthly backup backup possible in hestiaCP?

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!

:confused: :question:

Currently it is no supported

How/where can I just prong/force some bytes somewhere to retain the "?"s so that they get passed along to the cp command?

“no supported”, or BROKEN?

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!)

We don’t support to create monthly / weekly backups.

For ? in cronjobs it is probally also never added. Unless it is a standard function…

You probally need to write a bash script and call that via the the root user.

Also you can call cp from the admin user with sudo…

putting that (the source file to be copied) in double-quotes (") seems to have let my text evade hestia’s parsing!!! :smiley: So that should get my command passed along to cp when it’s time…

So that should mean that hestiaCP can do weekly and/or monthly backup backups!

would having a userid-monthly.tar in /backup bother hestia? would having it in /backup/backup be less bothersome (I think I’ll try it that way unless I hear otherwise)?

No it still doesn’t support it. It is still an hacky method and you you will not be able to restore from the user interface…

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

4 Likes

That solution is simple. I like it very much.

Thank you! I also needed this!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.