Change Remote Backup Folder Names...

PCZero

Well-Known Member
Dec 13, 2003
735
92
178
Earth
I have submitted a feature request at - Removed - for this, but I wanted to know if there is a way can make a modification on my own to do this now...

What I want to do is change the naming convention of the remote FTP back up folders slightly. In the current remote FTP back up process the back up files for the daily back ups are stored at the remote location root, but the weekly and monthly are stored, respectively, in the weekly and monthly folders/sub-directories. I want to store the daily back ups in a daily folder/sub-directory for uniformity and clarity. The way the back ups are stored now, the daily runs are stored with no indication of what level back up they are whereas the weekly and monthly are clearly described. If anyone knows where I can make the change to do this please help me out.

Thanks!
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

You could create a custom script that connects to the remote FTP server, creates the additional directory, and moves the backup archives into that directory. Then, you could setup an event hook that runs that script automatically after backups complete. EX:

Code:
/usr/local/cpanel/bin/manage_hooks add script /root/post_backup --category System --event Backup --stage post
Documentation: Hookable Events

Thank you.
 

PCZero

Well-Known Member
Dec 13, 2003
735
92
178
Earth
I actually thought about this. The issue is that (from the observations I have made), cPanel considers the back up complete once the packages have been created and not after the remote transfer have finished. While that may not be the actual case, I deduced this from the fact that this is the point where the 'backup complete' email is generated and sent. Therefore, in order to do as you suggest I would need to have a way to know when the actual remote transfer is done.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
You could configure your custom script to only run after a set time period or after a specific file or directory exists on the remote server.

Thank you.
 

PCZero

Well-Known Member
Dec 13, 2003
735
92
178
Earth
Thanks Michael. I am really hoping that whoever it is that has final say over changes will approve this one so it will all be done with not scripting required. I realize this is a rather low priority issue however I am thinking that maybe it could be as simple as cloning the code segment that create the 'weekly' and/or monthly directory structure and mod it slightly to have the same functionality for daily back ups.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Feel free to post the URL to the feature request here after it's been approved so others can vote for it and add input.

Thank you.