Automated domain snapshots
From DreamHost
Automated domain snapshots are a DreamHost service for keeping a few recent copies of the files in your DreamHosted domain as a backup. See Backup for references to other backup tools and strategies.
[edit] Snapshots
At DreamHost, we know everybody's data is important, no matter what plan they're on. That's why all our packages include full backup "snapshots" of your data at various regular intervals (two hourly, two daily, and two weekly). This means you get direct access to last two hours of backups , the last two days of backups and the last two weeks of backups. If you accidentally delete an important file, you can restore it yourself or let our customer service team know right away and we'll do our best to recover it in a recent state for you! Of course, you should ALWAYS keep your OWN backup copies of everything of any importance to you no matter what. But we'll do our best to make sure you never need them!
Steps for restoring data on your own :
-
cdinto the hidden directory named .snapshot (it will not show up in any directory listing at all, but it's there) - Choose how far back you would like to go ( hourly.0 is one hour ago, hourly.1 is two hours ago, nightly.0 is one day ago, nightly.1 is two days ago, weekly.0 is one week ago, weekly.1 is two weeks ago )
- Copy the restored file to where you want it. You're done! NOTE: You'll need to delete the original before replacing it with a copy from the snapshot.
* Please be advised that sometimes DreamHost will delete any, or all, .snapshot backups in order to make room on the network file servers. It doesn't happen often but it is something they are forced to do from time to time. More specific information about this is available here. As always, you should keep your own backup copies of everything of any importance to you no matter what".
NOTE regarding Private Servers: As of Dec. 27, 2007, attempting to enter the .snapshot directory (using cd ~/.snapshot from a shell account) will return this error: -bash: cd: /home/[username]/.snapshot: Operation not permitted. This is a known issue with Private Servers caused by a kernel level bug; however, the .snapshot backups do exist, but you must ask Support to perform restores for you for now. The plan is to resolve this within "the coming weeks" but no firm date has been confirmed. (Please remove this note when this is functioning, as well as the copy at Snapshot data restoration.)
This article contains a more detailed explanation of snapshots and tutorials on how to restore your files. Snapshot data restoration
[edit] FrontPage Backups (with Server Extensions installed)
DreamHost makes backups of your site that has FrontPage Server Extensions installed, but you can't access them. When FrontPage Server Extensisons are enabled, the .snapshot backup directory is no longer updated. Besides that, it's always a good idea to keep your own backups. This method will automatically create them for you:
Copy and past the following into a text file. For this example we'll call it fp.sh
#!/bin/bash suffix=$(date +%y%m%d) mkdir /home/user/joys cd /home/user/joys wget --mirror --non-verbose --domains=www.myDomain.com www.myDomain.com tar -cf /home/user/backups/archives/joys.$suffix.tar www.myDomain.com/ rm -r /home/user/joys
Upload that to your webspace. For this example we'll upload it into a directory called "backups"
use "crontab -e" from ssh to edit your cron tab. Just put in a line that looks something like:
30 2 * * 4 /home/user/backups/fp.sh
That will run the backup at 2:30 am every Thursday.
You'll also need to create the directory "joys" in your home directory, and "archives" under the backups directory.
Explanation: Using the wget utility in mirror mode basically pulls down the index file of the site, then gets all of the images and other stuff it links to, then follows the links and pulls those pages and images. It should keep directory structure as well.
--domains= Tells it to stick with my domain and not follow links to other sites that we don't want backed up.
--non-verbose is rather noisy though. It writes a single line for every file it downloads. And that will get E-mailed to you by cron. Not the best, hmm? you can change that to --quiet and that will make wget shut up entirely. The only problem, and the reason I'm using --non-verbose, is that quiet turns off errors too.
The script then creates a tar file using the current date in the file name. That's the suffix command, and it appears as name.YearMonthDay.tar
Lastly I clear out the files after the tar is created so every thing's nice and clean for next week.
To get your windows computer set up to automagically download the archives you create ever week, see Automatic Backup That article describes a solution to create backups of your non-FrontPage Server Extensions site, and in the second half covers getting your computer to download them for you.
[edit] See Also
- Backup, a portal to articles about backup strategies and tools in general.
- Snapshot data restoration, a more detailed explanation of snapshots and tutorials on how to restore your files.

