Skip to content

nickproud/linuxdailybackups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Linux Daily Backups

Incremental Backup Script

This Bash script performs incremental backups using rsync and allows you to specify the source and destination directories.

Usage

./dailybackup.sh <source_directory> <destination_directory>

Replace <source_directory> and <destination_directory> with the actual paths you want to use for the backup.

Features

  • 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.

Setup

  1. Navigate to the script directory:
  cd path/to/script/
  1. Make the script executable
  chmod +x dailybackup.sh
  1. 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.

Schedule the Script To Run at 2am daily

  1. Open Crontab
  crontab -e
  1. Add cron entry pointing to your script path
  0 2 * * * /path/to/script/dailybackup.sh <source_directory> <destination_directory>

Acknowledgements

I certainly can't take a lot of credit for this one. I had help from ChatGPT! Thanks #OpenAi 🙏

About

Incremental backups using rsync

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages