LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Does tar backup hidden files (https://www.linuxquestions.org/questions/linux-newbie-8/does-tar-backup-hidden-files-4175480184/)

RoyWalker 10-09-2013 01:23 PM

Does tar backup hidden files
 
Hello

If I backup my home directory, will my hidden files be included which I want of course or do I need to add an option to tar

Is this OK for a syntax

tar -cvphf /media/disk/myhome.tar /home/roy/

c create file
v verbose
p preserve permissions
h follow symlinks
f archive file

I would use rsync but I gotten error messages about preserving the permissions on the vfat partition via /media/disk

lleb 10-09-2013 01:30 PM

what was the exact error you got? were you backing up to the vfat device or from?

also yes tar should grab your hidden files.

RoyWalker 10-09-2013 01:56 PM

Don't remember the actual messages, this was a few days ago. I was backing it to the vfat external hard drive mounted on /media/disk

Firerat 10-09-2013 02:19 PM

questions like these are easy to answer


try it.. what happens?

and ref rsync
it will not preserve the permission, because vfat fs does not support permissions

tar is the correct way to archive such things,, but vfat is not a good choice for backups

RoyWalker 10-09-2013 02:26 PM

Hi lleb

I made a mistake, it wasn't the permissions. It was the symlinks that rsync had issues following to the vfat partition.

Here is a sample error message

rsync: symlink "/media/9C9E-A897/bin/qrencode" -> "../Downloads/build/qrencode-3.2.0/qrencode" failed: Operation not permitted (1)

I have some symlinks in my home directory. If my external drive were a linux filesystem, I wouldn't get those errors

I do need the symlinks to be followed, so I will have to use tar.

RoyWalker 10-09-2013 02:30 PM

Quote:

Originally Posted by Firerat (Post 5042964)
vfat is not a good choice for backups

Agree.

jpollard 10-09-2013 03:25 PM

Quote:

Originally Posted by RoyWalker (Post 5042935)
Hello

If I backup my home directory, will my hidden files be included which I want of course or do I need to add an option to tar

yes. Any .file (other than . and ..) will be backed up.
Quote:

Is this OK for a syntax

tar -cvphf /media/disk/myhome.tar /home/roy/

c create file
v verbose
p preserve permissions
h follow symlinks
f archive file

I would use rsync but I gotten error messages about preserving the permissions on the vfat partition via /media/disk
It depends on what you want.

Following symlinks can cause all kinds of problems - think about what would happen if you created a symbolic link with "ln -s / testlink". You would then be creating a tar of both the specific sub tree (/home/roy/) but would also include the files in /... which would eventually include the files in "/home/roy/". And you would never finish... Hopefully tar would recognize such an error.

lleb 10-09-2013 07:19 PM

Quote:

Originally Posted by RoyWalker (Post 5042970)
Hi lleb

I made a mistake, it wasn't the permissions. It was the symlinks that rsync had issues following to the vfat partition.

Here is a sample error message

rsync: symlink "/media/9C9E-A897/bin/qrencode" -> "../Downloads/build/qrencode-3.2.0/qrencode" failed: Operation not permitted (1)

I have some symlinks in my home directory. If my external drive were a linux filesystem, I wouldn't get those errors

I do need the symlinks to be followed, so I will have to use tar.

replace the -h with -S, but yes as firerat pointed out the vfat file system does not support proper permissions and can have issues with symlinks as it has no clue what to do with either.

i will typically just use scp vs rsync when moving data to vfat devices that have to be accessed by Linux and other OSs.


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