You want to make some backups with tar.
tar is very functional and has many uses.
If you are lucky enough to have GNU tar (tar –version will return GNU if so), then you can compress and backup at the same time. 🙂
tar zcvf /tmp/filename.tgz .
This backups and zips the contents of the current directory, to filename.tgz in tmp directory.
If not – no drama. This will backup and pipe through content to gzip, which then zips it.
tar cvf - . | gzip --best > /tmp/filename.tgz
Recreate a directory:
tar -C old -cf - . | tar -C new -xvf
Restore over the network:
ssh remote_hostname "(tar -cf - remote_directory)" | tar -xvf -
ssh bree "(tar -cf - Perl_Bin)" | tar -xvf -
[tags]tar, backups, restores, Unix Coding School[/tags]