LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   backup (https://www.linuxquestions.org/questions/linux-newbie-8/backup-691852/)

ekamlesh 12-20-2008 03:54 AM

backup
 
I want to backup a 20 GB folder using tar. The question is how to tell tar to create a tar files of size 4.2 GB only so that it is possible to write them on a DVD.

billymayday 12-20-2008 04:09 AM

You may be able to use the -L option with tar, but when I've needed to limit the size, I've simply created a large tarball, then run it through split (since, as I recall, -L doesn't mix with compression).

I'm sure you could pipe the tarball directly through split if you wanted.

See man split

ekamlesh 12-21-2008 10:59 PM

I followed billymayday's suggestion and created huge tar ball of my back up. But I have the following problem. Tar is able to read [while extracting files] only the first file created by split (i.e xaa), but for other files(xab,xac, ..), it just says that it is an empty archive. Do i need to do something more, or I am missing something. Please guide me. Thanks in advance.

AuroraCA 12-21-2008 11:09 PM

This is an old and established option of tar for tape backups. You should be using tar with -cML options.

See: http://www.gnu.org/software/tar/manu...ia.html#SEC156

Create your multi-volume tar backups and copy each volume to your CD or DVD.

billymayday 12-21-2008 11:51 PM

If you split them, you need to rejoin (with cat)

dv502 12-22-2008 12:38 AM

@ekamlesh

Code:

cat x* > big-tar-file.tar
Assuming you used the default naming scheme of split.

Replace the red with your actual files.

When you plan to restore your files make sure you have enough drive space.

The splitted tar files plus the final full version will require about 40G of drive space. After you've created the full version, you can delete the splitted tar files.

I prefer using rsync when backing up files, and when used with the delete option, it makes a mirror copy of the source and destination folders.

Be careful though, if you misuse the delete option, it can delete files you didn't want deleted. See the man page for rsync or google it.

- Cheers


All times are GMT -5. The time now is 05:06 AM.