September 16, 2011
how to backup your home dir (on a shared)
reqs:
1. no root, no access outside home
2. backup hidden (.*) files/dirs
It seems simple, but actually is tricky task, because tar tries to include the tar.gz archive being created at the moment, and zip does not want to include hidden, or includes them recursively (try "zip -r a .*" - it includes /.*, ./../* and so on :-) for me it was unexpected)
So the right command is:
1. no root, no access outside home
2. backup hidden (.*) files/dirs
It seems simple, but actually is tricky task, because tar tries to include the tar.gz archive being created at the moment, and zip does not want to include hidden, or includes them recursively (try "zip -r a .*" - it includes /.*, ./../* and so on :-) for me it was unexpected)
So the right command is:
tar -cvzf testing.tar.gz --exclude=testing.tar.gz .