Difference between revisions of "Restoring a backup"

From Redbrick Wiki
Jump to navigation Jump to search
(Update with current information.)
Line 1: Line 1:
If this has happened to you, you're able to restore your backups by copying files from redbricks backups.
+
Redbrick keeps regular backups of your files in case a problem develops with a server and user files need to be restored.
  
==Causes of needing to restore backups==
+
These backups can also be used by users to restore files if they have accidentally deleted a file or wish to restore previous editions of files.
===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.<br/>
 
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==
+
==Restoring a backup==
 
<pre>
 
<pre>
ssh carbon
+
cd /backup/storage/current/ *See Note 1
cd /backup/webtree/webtree/u/username (see note)
+
cd webtree *See Note 2
cp filename ~/public_html/    OR cp -R * ~/public_html/
+
cd u/username *See Note 3
exit
 
 
</pre>
 
</pre>
  
 +
To restore a single file then
 +
<pre>
 +
cp filename ~/public_html/
 +
</pre>
  
====Note====
+
To restore an entire directory then
 
 
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==
 
 
<pre>
 
<pre>
ssh carbon
+
cp -R * ~/public_html/
cd /backup/webtree/webtree.1/d/drag0n
 
cp index.html ~/public_html/
 
exit
 
 
</pre>
 
</pre>
 
+
====Note====
This will copy drag0ns (ie. me) index.html from a backup from 2 days ago into drag0ns public_html folder.
+
#Redbrick keeps several backups at one time. current is the latest and is usually taken the night before. If you wish to restore a backup from before this replace current with the date of the backup and then type cd tree before continuing with the guide.
 +
#You can also restore files from your home directory by going to /home/member during this step. If you are restoring a backup from home replace public_html in the later steps with a more appropriate location. eg. ~
 +
#In this example the user is called username. Replace this with your username and u with the first letter of your username. eg. i/isaac702
  
 
[[Category: Helpdesk]]
 
[[Category: Helpdesk]]
 
[[Category: HowTo]]
 
[[Category: HowTo]]

Revision as of 21:48, 29 September 2010

Redbrick keeps regular backups of your files in case a problem develops with a server and user files need to be restored.

These backups can also be used by users to restore files if they have accidentally deleted a file or wish to restore previous editions of files.

Restoring a backup

cd /backup/storage/current/	*See Note 1
cd webtree			*See Note 2
cd u/username			*See Note 3

To restore a single file then

cp filename ~/public_html/

To restore an entire directory then

cp -R * ~/public_html/

Note

  1. Redbrick keeps several backups at one time. current is the latest and is usually taken the night before. If you wish to restore a backup from before this replace current with the date of the backup and then type cd tree before continuing with the guide.
  2. You can also restore files from your home directory by going to /home/member during this step. If you are restoring a backup from home replace public_html in the later steps with a more appropriate location. eg. ~
  3. In this example the user is called username. Replace this with your username and u with the first letter of your username. eg. i/isaac702