[Portugal] Smart, selective backup of files with Linux

termal12 termal12 at gmail.com
Sun Jun 6 14:44:02 EDT 2010


http://www.simplehelp.net/2010/04/15/smart-selective-backup-of-files-with-linux/

Enviado para você por termal12 através do Google Reader: Smart,
selective backup of files with Linux via Simple Help de Sukrit
Dhandhania em 15/04/10

There are a number of backup methods that you can use in Linux to make
sure your data is safe and available. The simplest is probably to
backup everything. This method, although viable under certain
circumstances, is not always the smartest way to go if you have space
constraints. So you can use a more selective backup method. Let’s look
at one, wherein you choose the files you want backed up, and run a
single line command to backup only these files.

Launch your favorite text editor and make a list of all the files you
want to back up. Put the full path of each file, and have one file per
line. So your final list will look something like this:

/etc/passwd
/etc/users
/home/calvin/accounts.txt
/home/calvin/otherimportantstuff.tar.gz
…

Save the file with a name like backup_list.txt, or whatever you find
suitable. Now we’ll use the tar command with an extra input parameter,
-T. The upper case T is a parameter that takes a list of files as input.

The command to archive a directory without the -T parameter is:

# tar -zcf archive.tar.gz directory-to-backup

We will now modify this command so that it takes the list we prepared
for it as an input. We will do this using the -T option in tar:

# tar -zcf backup.tar.gz -T /etc/backup_list.txt

Check out the contents of the newly created archive, backup.tar.gz. It
should contain the files you listed in the file backup_list.txt. You
can make this command a bit smarter using the date command in Linux.
Use this command to have Linux automatically insert the date of the
backup into the filename of the archive you create. Modify the above
command to look something like this:

# tar -zcf backup-`date +%Y-%m-%d`.tar.gz -T /etc/backup_list.txt

Now the archive file containing your backup will have the date, month
and year of the backup. This makes it easier to store and retrieve data
from your backups.

---
Related Articles at Simple Help:How to create and use Smart Folders in
OS X
How to set selective (not all) tweets as your Facebook Status
How to use Firefox's Smart Keywords more effectively
How to create and extract zip, tar, tar.gz and tar.bz2 files in Linux
How to run a remote backup over SSH





Coisas que você pode fazer a partir daqui:
- Inscrever-se no Simple Help usando o Google Reader
- Começar a usar o Google Reader para se manter facilmente atualizado
sobre todos os seus sites favoritos
-------------- próxima parte ----------
Um anexo em HTML foi limpo...
URL: http://lists.osgeo.org/pipermail/portugal/attachments/20100606/ec1cb5a0/attachment.html


More information about the Portugal mailing list