server-tools !?!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 rivejä
479 B

  1. #!/bin/bash
  2. # Variables
  3. BACKUP_ROOT_FILES="/backup/files"
  4. BACKUP_FILES_RETENTION=10
  5. # Starting backup
  6. echo "Starting files backup process ..."
  7. # Backup server configuration
  8. mkdir -p ${BACKUP_ROOT_FILES}
  9. HOUR=`date +%Y%m%d%H%M`
  10. tar czf ${BACKUP_ROOT_FILES}/files_${HOUR}.tar.gz /etc
  11. # Purge old backup
  12. echo "Starting files purge process for backup older than ${BACKUP_FILES_RETENTION} ..."
  13. find ${BACKUP_ROOT_FILES} -type f -mtime +${BACKUP_FILES_RETENTION} -exec rm -f {} \;