|
 |
Technical
Paper
Recovering files from nightly backups |
Fusion Source keeps nightly
backups of your files in a hidden directory called
".snapshot". Every directory under your home directory
has its own .snapshot directory, with backups from the last 5
days.
In .snapshot, there is a
separate directory for each nightly backup. nightly.0 is the
backup made last night, nightly.1 is the backup made 2 nights
ago, etc. The file weekly.0 is the backup made last Friday,
which could be last night or 6 days ago, depending on the day of
the week.
Here are the steps to
recovering a file from backup:
- Telnet to your account and
change into the appropriate directory.
- If you deleted a file and
need to replace it, skip to step 3. If you modified a file
and need to replace it, make a backup of the new file,
because you may want it back later!
- Change into the .snapshot
directory.
- If you want the copy of the
file from last night, go into nightly.0, from 2 nights ago,
nightly.1, from 3 nights ago, nightly.2, etc. If you want it
from the last weekly backup (last Friday), go into weekly.0.
- Copy the file back into the
appropriate directory. (You will not be able to move a file
out of the .snapshot directory; you'll only be able to copy
it.)
Here is an example telnet session.
Let's say you modified the file htdocs/pages/widgets.html, and
then later decide you need the version from 3 days ago. The
items in bold are what you'd type into your telnet session, and the
items in italics are comments to explain what's happening.
Get into the
appropriate directory.
{infobultra3:login} cd htdocs/pages
List
the contents of that directory.
{infobultra3:login} ls
counter.htm
thanks.html
file.tpl
widgets.html
mail1.htm
widgets2.html
mail5.htm
widgets2.html.bak
Make a backup
of the new file.
{infobultra3:login} mv widgets.html widgets.html.new
Get
into the backup directory.
{infobultra3:login}
cd .snapshot
{infobultra3:login}
ls
nightly.0/
nightly.2/ nightly.4/
nightly.1/
nightly.3/ weekly.0/
Locate the
backups from 3 nights ago.
{infobultra3:login} cd nightly.2
{infobultra3:login} ls
counter.htm
thanks.html
file.tpl
widgets.html
mail1.htm
widgets2.html
mail5.htm
widgets2.html.bak
Copy the old
file back.
{infobultra3:login} cp widgets.html ~/htdocs/examples
The symbol "~" is a Unix shortcut which
means your home directory. When logged into a shell account
you should not use this shortcut. Instead, enter the full path
beginning with /export/...
choose another technical paper
|