Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.
This object is in archive! 

Detect existing backups when requesting a homedir backup.

Corry Jh shared this idea 10 years ago
Needs Feedback

Since the FullSiteBackup page can tell you if you have existing backups, it seems logical that the homedir backup should be able to tell also.


When a homedir backup is requested, If a full backup is currently in the home directory, a warning should be given to ask the user if they are sure they want to run the backup. Better yet, you could offer to exclude that file.

Best Answer
photo

The homedir backup and full backup behave in vastly different ways.


Full Backup :: This calls the /scripts/pkgacct script and generates a full proper backup which includes leveraging much cPanel & WHM code and other logic. The resulting backup is automatically stored within the user's homedir for later download.


Homedir Backup :: Quite literally, the only thing this functionality does is stream output from the command "tar -czpf - ." run from the user's homedir. It never actually creates a backup file on the server and it has zero logic to determine what to backup. It just streams the homedir content in tarball form.


Therefore, a homedir backup never ends up on the server *unless* the customer were to re-upload it manually. Are you comfortable with cPanel & WHM making an assumption just based upon naming scheme alone of a file that it is a relevant backup? These "partial" backups are pretty much intended to be streamed down to a local machine and backed up off-site like such, only uploaded to the cPanel & WHM server when a restoration needs to occur.


I am apprehensive about the assumptions this feature makes, especially when the only way a homedir backup can end up in a user's homedir is by consciously uploading it there (unlike how full backups generate on the server).


I'd like to hear further input from more customers to see if this would interest them.

Replies (3)

photo
1

The homedir backup and full backup behave in vastly different ways.


Full Backup :: This calls the /scripts/pkgacct script and generates a full proper backup which includes leveraging much cPanel & WHM code and other logic. The resulting backup is automatically stored within the user's homedir for later download.


Homedir Backup :: Quite literally, the only thing this functionality does is stream output from the command "tar -czpf - ." run from the user's homedir. It never actually creates a backup file on the server and it has zero logic to determine what to backup. It just streams the homedir content in tarball form.


Therefore, a homedir backup never ends up on the server *unless* the customer were to re-upload it manually. Are you comfortable with cPanel & WHM making an assumption just based upon naming scheme alone of a file that it is a relevant backup? These "partial" backups are pretty much intended to be streamed down to a local machine and backed up off-site like such, only uploaded to the cPanel & WHM server when a restoration needs to occur.


I am apprehensive about the assumptions this feature makes, especially when the only way a homedir backup can end up in a user's homedir is by consciously uploading it there (unlike how full backups generate on the server).


I'd like to hear further input from more customers to see if this would interest them.

photo
2

cPanelBrianO, I think you might have misunderstood what I meant. When you make a fullsite backup, the default destination for that backup is "Home Directory" or /home/~username/backup-m.dd.yyy_hh-mm-ss_username.tar.gz


The normal thing to do is to download that file and delete it from the server.


If one forgets to delete it, then makes a backup of homdir, then they are backing up a backup. So, if one selects "Download a Home Directory Backup" then I am asking for a check for any files whose name is like "backup-m.dd.yyy_hh-mm-ss_username.tar.gz" and then a prompt "There is a fullsite backup in your home directory. Do you want to continue?"

photo
1

If accidentally including backup files within your new backups is a concern, then this is something that I'm pleased to say our backup system already takes into account.

There's code in the "Download or Generate a Full Website Backup" backup generation logic that skips over backing up any other full backups stored in the user's homedir.


There is not any logic for this in the "Download a Home Directory Backup" backup logic, however, as the feature does exactly what it says. It grabs exactly what's in your homedir, regardless what it is. The backup type would have to be renamed to not be a "homedir" backup if we started excluding items from the homedir during backup.


In short, if you want to ensure you never include a backup within your backup, use the "Download or Generate a Full Website Backup" feature. If you want an exact copy of the homedir, regardless if it has backups in it, then use the "Download a Home Directory Backup" feature.


This is by design and is intentional.

Leave a Comment
 
Attach a file