Nightly Backups

Although most backups are done at night, and hence this document is entitled “Nightly Backups”, not all backups are done each night.

NIGHTLY BACKUPS ARE DONE WITH NO WARRANTY. THE PROCEDURES DESCRIBED IN THIS DOCUMENT MAY CHANGE WITHOUT NOTICE. NOT ALL CHANGES IN BACKUP POLICIES WILL ALWAYS BE REFLECTED IN THIS DOCUMENT.

All important filesystems containing user home directories and web directories are periodically backed up. This applies to both our Classic Linux environment and our DirectAdmin environment.

Backups are done on a rolling basis and saved for a variable period of time, which is usually anywhere from a few weeks to many months, depending on availability of backup space and the policy in effect at that time. These backups work best for files that exist for at least a few days, so there is an opportunity for them to get backed up. Files that exist briefly and are then deleted, such as recent mail messages, might not get included in a backup.

Rsnapshot Backups

We use a program called “rsnapshot” to make the backups described here. These backups are self-service, i.e., you can access them at any time to find your directories and files from the past.

These backups will greatly help minimize the likelihood of loss of data. They are not a guaranteed solution, but rather, just one more precaution that adds to the overall reliability and usefulness of our network.

How to Access

To access these backups, log in via ssh or sftp, then cd into the directory relevant to you:

/backups/classic    to access Classic Linux backups
/backups/jade       to access DirectAdmin backups of jade
/backups/sunshine   to access DirectAdmin backups of sunshine

These directories are automatically mounted when accessed, so they won't necessarily be visible until you explicitly cd into them. If you cd into /backups and then do “ls”, you might see nothing there, so cd into the full path given above.

Each backup directory listed above will be accessible only on machines of the same type. E.g., if you are logged in on jade.rahul.net, only /backups/jade will be accessible. If you try to cd to one of these directories and it does not appear, or times out, try again a few minutes later, just in case the server from which the directory is mounted was temporarily slow or unavailable.

If you are using a web-based file browser (as is likely on jade or sunshine), the file browser will not necessarily show the directories described above. Just log in with ssh or sftp, and cd there first, and then the directory will appear and should become visible in the web-based file browser.

Backup Directory Names

Under the directories listed above, you will find the actual backup directories. Their various names are described below.

Directories daily.0, daily.1, ..., daily.N

These contain daily backups. The most recent one is daily.0. The next most recent one is daily.1, and so on, and daily.5 will usually contain a backup done about five days ago.

Backups might occur more often or less often than exactly once a day. In each of the daily.0, daily.1, … directories, look for files called “starttime.txt” and “endtime.txt”. The timestamps of these file, and also their contents, will tell you approximately when the backup started and ended.

Directories weekly.0, weekly.1, ..., weekly.N

These are like the daily backups, except they are done weekly. The most recent one is weekly.0.

Directories monthly.0, monthly.1, ..., monthly.N

These are like the daily and weekly backups, except they are done monthly. The most recent one is monthly.0.

Lower Directory Names

Below the directories described above you will find subdirectories named after one or more machines.

Home directories of Classic Linux users will usually be found under the machine name “firebrick”. Home directories of DirectAdmin users will be found under the name of the machine into which they normally log in. For example:

/home/BACKUPS/rsnapshot/firebrick/daily.5/firebrick
/home/BACKUPS/rsnapshot/jade/daily.5/jade
/home/BACKUPS/rsnapshot/sunshine/daily.5/sunshine

Below the above directories, you will find names of home directory trees. Due to the way home directory filesystems are sometimes mounted, the directory name of the backup might not exactly match your home directory pathname.

To find your own backups, first find the pathname of your home directory using the commands below. The first command below, “cd”, puts you into your home directory. The second one, ”/bin/pwd” (be sure to use this full pathname instead of just typing “pwd”), prints your current directory.

cd
/bin/pwd

Only if you are a Classic Linux user, also use this command:

/usr/local/bin/cpwd

which prints a simplified pathname for your current directory.

Now you have one or two paths for your home directory.

Now browse the backups and look for a directory pathname that closely resembles your home directory pathname, even if it's not identical. Once you find your home directory, you will recognize it, because the 'ls -l' command will show your own login name and your own files.

Inside this backup of your home directory, you will find all the directories and files that were there when the backup was done, laid out in the same directory hierarchy.

Backups are mounted read-only, so you can access your backed-up files but you won't be able to modify them where they are. Once you find the file you are looking for, simply copy it from the backup location into your own home directory.

Directory and File Permissions

The usual Linux file protections apply in the backups too. So you can access the same directories and files in the backups that you could access in their original locations.

Recommended Best Practices

1. Take a look at our backups occasionally, and confirm that your files are being backed up. This will give you some assurance that the backups will be there when you need them. Also, once in a while, pretend you lost a specific file some days or weeks ago, and see if you can find a backup copy. This will give you practice using the backups, so you can have some assurance that you will know how to recover files when you actually need them.

2. Make your own backups, too. In the DirectAdmin environment, your control panel menu will let you download a backup, in tar archive form, at any time. In the Classic Linux environment, although there is no menu to let you download a backup, you may use the usual tools (e.g., tar or cpio) from the shell to make and download a backup archive.

 
nightly_backups.txt · Last modified: 2017-01-16 06:13 by dhesi
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki