This Bash script performs incremental backups using rsync and allows you to specify the source and destination directories.
./dailybackup.sh <source_directory> <destination_directory>Replace <source_directory> and <destination_directory> with the actual paths you want to use for the backup.
- Incremental Backups: Uses rsync to perform incremental backups, saving disk space.
- Timestamped Backups: Each backup is timestamped for easy identification.
- Latest Symlink: Maintains a 'latest' symlink pointing to the most recent backup for quick access.
- Optional Old Backup Removal: Removes old backups based on a configurable retention policy.
- Navigate to the script directory:
cd path/to/script/- Make the script executable
chmod +x dailybackup.sh- Run the script
./dailybackup.sh <source_directory> <destination_directory>You will most likely want to be able to schedule this script! You can use crontab to achieve this.
- Open Crontab
crontab -e- Add cron entry pointing to your script path
0 2 * * * /path/to/script/dailybackup.sh <source_directory> <destination_directory>I certainly can't take a lot of credit for this one. I had help from ChatGPT! Thanks #OpenAi 🙏