Option to create /daily symlink to newest changing zzzz-yy-xx backup directory when new backup runs
Open Discussion
As a server administrator I would like cPanel to provide a symlink (named /daily or /latest, for example) in the /backup directory that would take me to the most recent backup, to allow me to more quickly and consistently identify the most recent backup, rather than manually parsing the folders and files in the directory tree.
This would be especially helpful in situations where I would like to programmatically sync my backups to another location.
I wrote a quick PHP hook that accomplishes this:
Instructions:
Save the following to /root/custom_scripts/backup_hook.php
Set executable:
Add the hook:
If you choose to save the script in a different directory, you will have to edit the file. Also, make sure to edit the BACKUP_DIR up at the top of the script. The default is /backup/ (trailing slash needed). Once the backup completes, it will create a latest symlink to the most recent directory.
I wrote a quick PHP hook that accomplishes this:
Instructions:
Save the following to /root/custom_scripts/backup_hook.php
Set executable:
Add the hook:
If you choose to save the script in a different directory, you will have to edit the file. Also, make sure to edit the BACKUP_DIR up at the top of the script. The default is /backup/ (trailing slash needed). Once the backup completes, it will create a latest symlink to the most recent directory.
Replies have been locked on this page!