Ability to specify a dynamic dated append value in backup paths (SKINS)

Version 1.45

Feature
Finished

Dynamic backup paths allowing for multiple rotating/overwriting backup repositories with only 1 cronjob. When creating a backup at: Admin Level -> Admin Backup/Transfer a new select-box called "Append to path" in the "Step 3: Where" section, that lets you select a dynamic value for DA to append to the end of the backup path. It applies to both local and remote ftp paths. The dropdown options are: - Nothing - Day of Week: /Tuesday - Day of Month: /4 - Week of Month: /week-2 - Month: /Mar (this will be only the 3 letter abbreviation) - Full Date: 2014-03-04 (this doesn't rotate, it will keep the backups forever) - Custom: strftime for advanced usage. See http://help.directadmin.com/item.php?id=539 It's important to use the correct append value for your cron frequency.. else it may not give you expected results. If you run a cronjob every day, and select "Month", then it will overwrite the same backup everyday for that entire month. You'd usually pick a value that matches your cron frequency.. eg: daily backup, you'd use either Day of Week or Day of Month. A weekly backup, use the Week of Month value, and Monthly use use the Month. The full Date value is for cases where you never want to delete your backups, but this would eventually lead to a full disk, so a custom cleanup cron would be needed. The ftp backup pre-check will only do so on the ftp path, it doesn't check if /Wednesday exists. But we rely on the ncftpput -m option to create the /Wednesday folder in the ftp path... so ncftpput will create the /Wednesday folder, if it's missing. ----- Example usage for daily backups, in 7 repositories, Sunday to Saturday. Local Path: /home/admin/admin_backups And set Append to path: Day of Week If this backup is created "now", then it will create the bacukps in the path: /home/admin/admin_backups/Tuesday but if you create a cronjob with the same values, and the cronjob runs tomorrow, when the cron runs, it backs up to the path for that day, eg: /home/admin/admin_backups/Wednesday /home/admin/admin_backups/Thursday This lets you create only 1 cronjob, when you previously needed to create 7, each with a different path. (for this particular scenario) Old way: http://help.directadmin.com/item.php?id=146 Of course, the above example is if you'd create a cron that runs every day, where you'd want ----- ============== SKINS: admin/admin_backup.html admin/admin_backup_modify.html Added this info, just below the ftp backup information: <tr><td class=listtitle>&nbsp;</td> <td class=listtitle> - Append to path |PATH_APPEND| </td> </tr> <tr class="|CUSTOM_PATH_CLASS|" id="custom_path"><td></td> <td class=list> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Append: /<input type=text name="custom_append" value="|CUSTOM_APPEND_VALUE|" size=21> <a target=_blank href="http://help.directadmin.com/item.php?id=539">(?)</a>&nbsp; </td> </tr> Also, a new javascript function is added near the top: function set_custom_path() { if (document.getElementById('append_path').value == 'custom') document.getElementById('custom_path').className = 'path_visible'; else document.getElementById('custom_path').className = 'path_hidden'; } Lastly, the style.css page needs 2 new classes: .path_hidden { visibility: hidden; } .path_visible { visibility: visible; }

Interested to try DirectAdmin? Get a 30-day Free Trial!