Synchronizing files and directories with rsync and working towards a full system backup with cron
In this recipe, we will investigate the need to synchronize files and directories with rysnc on the command line. We will then use this introduction to build on a previous recipe discussing cron and illustrate how a simple bash script can be used to implement a fully automated backup process.
Rsync can be used to synchronize files and directories across a variety of local and remote locations. It can interact with multiple operating systems, work over SSH, provide incremental backups, execute commands on a remote machine, and replace the need for the copy
command. Rsync is an invaluable asset for any system administrator who intends to run a server or manage a network of computers as it not only simplifies the process of making backups in general, but it can be used to action a complete backup solution, and for this reason it is the purpose of this recipe to offer a suitable starting point for...