Restoring a backup: Difference between revisions
Line 11: | Line 11: | ||
<pre> | <pre> | ||
ssh carbon | ssh carbon | ||
cd /backup/webtree/webtree | cd /backup/webtree/webtree/u/username (see note) | ||
cp filename ~/public_html/ | cp filename ~/public_html/ OR cp -R * ~/public_html/ | ||
exit | exit | ||
</pre> | </pre> | ||
====Note==== | |||
There are 7 backup directories in /backup/webtree/ and /backup/home/. The newest of each of these are the ones without numbers (/backup/webtree/webtree/, and /backup/home/home). These are the backups for the previous night. The backup for two nights ago is .1, three nights is .2, and so on. | |||
The example given above is for a user called 'username'. As you can see, the first directory you put in is the first letter of your username, followed by your full username. | |||
==Example of restoring a file== | ==Example of restoring a file== |
Revision as of 16:38, 19 February 2007
If this has happened to you, you're able to restore your backups by copying files from redbricks backups.
Causes of needing to restore backups
Deleting all your files in a directory
rm * //Very bad, will delete all files from current folder
Overwriting a file.
If you're using vim, it will prompt you that you are overwriting a file if you didn't open the file for editing in the first place.
It tells you to add a ! to the write command to overwrite the file. Don't do this unless you're sure of what you're doing.
Howto restore from a backup
ssh carbon cd /backup/webtree/webtree/u/username (see note) cp filename ~/public_html/ OR cp -R * ~/public_html/ exit
Note
There are 7 backup directories in /backup/webtree/ and /backup/home/. The newest of each of these are the ones without numbers (/backup/webtree/webtree/, and /backup/home/home). These are the backups for the previous night. The backup for two nights ago is .1, three nights is .2, and so on.
The example given above is for a user called 'username'. As you can see, the first directory you put in is the first letter of your username, followed by your full username.
Example of restoring a file
ssh carbon cd /backup/webtree/webtree.1/d/drag0n cp index.html ~/public_html/ exit
This will copy drag0ns (ie. me) index.html from a backup from 2 days ago into drag0ns public_html folder.