LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2013, 02:23 PM   #1
RoyWalker
LQ Newbie
 
Registered: Oct 2013
Distribution: Pinguy, tinycore 4.7, android 4.1.2
Posts: 8

Rep: Reputation: Disabled
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

Last edited by RoyWalker; 10-09-2013 at 02:25 PM.
 
Old 10-09-2013, 02:30 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
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.
 
Old 10-09-2013, 02:56 PM   #3
RoyWalker
LQ Newbie
 
Registered: Oct 2013
Distribution: Pinguy, tinycore 4.7, android 4.1.2
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-09-2013, 03:19 PM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
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

Last edited by Firerat; 10-09-2013 at 03:25 PM.
 
Old 10-09-2013, 03:26 PM   #5
RoyWalker
LQ Newbie
 
Registered: Oct 2013
Distribution: Pinguy, tinycore 4.7, android 4.1.2
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.

Last edited by RoyWalker; 10-09-2013 at 03:29 PM.
 
Old 10-09-2013, 03:30 PM   #6
RoyWalker
LQ Newbie
 
Registered: Oct 2013
Distribution: Pinguy, tinycore 4.7, android 4.1.2
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
vfat is not a good choice for backups
Agree.
 
Old 10-09-2013, 04:25 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by RoyWalker View Post
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.
 
Old 10-09-2013, 08:19 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by RoyWalker View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tar ONLY hidden files MS3FGX Linux - Software 13 01-13-2014 11:46 AM
tar doesn't compress .hidden files in the same directory it is run in? BassKozz Linux - Newbie 2 06-02-2009 05:46 PM
How to backup /home except hidden/system files glenn69 Linux - General 3 05-16-2007 10:46 AM
Can I back up hidden files using tar? opto Linux - Newbie 6 11-05-2006 10:35 AM
tar and hidden files jjthomas Linux - General 4 04-07-2005 09:37 PM


All times are GMT -5. The time now is 09:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration