Skip to main content

Auto Delete Backup Directory Before New One Generated

Comments

2 comments

  • cPanelMichael
    Hello :) Have you considered using incremental backups? You can choose this setting to store only one uncompressed backup file. The system saves updated account information to the existing backup file, and removes the old information that these updates replace. This setting limits your restoration settings, but runs faster and uses less disk space than other backup types. Thank you.
    0
  • chalupa
    Would be better to just remove the .tar.gz files and let cPanel remove the directory itself. Most of the space is taken up by them anyways 30 2 * * * find /backup -type f -ctime +2 -name '*.tar.gz' -exec rm -rf {} \; But the cPanel backups will run after this by default. 1am for legacy and 2am for new backups. So you want that to run earlier than the backups fire? Maybe 30 1 * * * find /backup -type f -ctime +2 -name '*.tar.gz' -exec rm -rf {} \; or if you use legacy backups 30 0 * * * find /backup -type f -ctime +2 -name '*.tar.gz' -exec rm -rf {} \;
    0

Please sign in to leave a comment.