This script save selected files compressed to a .tar.gz format in a folder that has a maximum number of files, exceed it the oldest file will be automatically deleted then the new one will be saved.
To run the script, use these commands :
-
Give execute permission to your script: chmod +x /path_to_the_script/Backup.sh
-
And run your script: /path_to_the_script/Backup.sh
Use it with cron or at to run it periodically at fixed times, dates, or intervals.