Backup for day

MisterM

Verified User
Joined
Jul 31, 2022
Messages
350
Hello

Is it possible to create daily backups? How do you go about it?

By 3 days for example, by having the copy of the 1,2,3 day to carry out.
 
I create daily backups and FTP them to a Truenas system, here i keep backups for 7 days and then with a cron i let it automaticly delete older backups.
 
You can setup daily backup for lets say for the latest 7 days, the oldest will be overwritten with the new one.
You can do this by setting for Append to path : Day of the Week
Example : To backup each day at 5 AM set the cron at 0 5 * * * for cron schedule
 
On my truenas i have this Cronjob to delete old files (more than 7 days)
find /mnt/my/folders/here/* -type f -mtime +7d -print0 | xargs -0 rm -f
 
Cron jobs like that are dangerous, what happens if backups stopped for 8 days ago and you didn't notice and you needed to restore a backup. You would have no backups. Better to use folders for the last 7 days as was mentioned. I also like to go one step further and do a file level backup of my servers that is independant of DirectAdmin that does a deduplicated backup snapshot every 6 hours, have roughly a 30 days retention.
 
also if you need auto-rewrite for backups without dangerous scripts - just use few tasks and few dirs. like:
0 1 * * 1,4 /dir1
0 1 * * 2,5 /dir2
0 1 * * 3,6 /dir3
0 1 * * 7 /weekly
 
one step further a file level backup that is independant of DirectAdmin that does a deduplicated backup snapshot every 6 hours
May I ask how you have done this setup, with extra software, and external storing if? Thank you.
 
Last edited:
@johannes for my file level backups I have been using UrBackup, there's probably better options out there but been using it forever and haven't seen a need to switch. I configure it to backup /etc/, /home/, /var/, /usr/local/directadmin/... anything else I don't really bother as I can spin up a new VM and provision fairly quickly from an image if needed. Didn't mention, that all VM's are also backed up daily with a retention of last 3 days of full backups for fast disaster recovery to a new host (which i can then quickly restore any files that happened after the image backup), each production host (using Proxmox, easy backup/snapshots for upgrade to easily roll back if an issue, works fine for my purpose) only runs a couple VM's.
 
Back
Top