Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

PART 3: Useful Scripts > CHAPTER 39: System Snapshots

CHAPTER 39
System Snapshots

Disk snapshots are a way of taking backups of files and directories at given time intervals. By accessing the specific snapshot interval, you can go back in time and find the version of a file from its snapshot backup. The script in this chapter backs up a list of directories that is configurable within the script; the backup is either at another location on the same disk, or on a separate disk altogether.

This script takes a copy of the original source directories and backs them up as the first snapshot. Any subsequent snapshot backups use hard links for any files that have not changed, and any changed files are copied. Like a soft link, a hard link allows multiple points of access to a single file, but a soft link is just a pointer to the original file whereas a hard link is a secondary or tertiary file that points to the same data as the original. Once a hard link is established, there is no distinction between it and the original file except for name and path. The benefit in using a hard link is that you have the same file (since it was not modified) in multiple snapshot locations, but it is not taking up any extra disk space. This is all performed with the rsync command.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint