LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2020, 08:22 AM   #1
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Rep: Reputation: Disabled
File permissions with tar


Hello, I have a file, mybackuplist, with a list of paths:
/home/yod/somefile
/home/yod/Documents/someotherfile

etc...
I use it to make a tarball with the following command
tar -cpvf backup.tar -T mybackuplist
I noticed that the file permissions are indeed saved but the directories permissions are lost,
so someotherfile maintains the correct permissions
but
/home/yod/Documents
/home/yod
/home

lose the permissions

Now, if in the file list, I specificy the directory instead of the file, the directory and the file permission are saved correctly.
So if in mybackuplist I specify
/home/yod/Documents/
The permissions of
/home/yod/Documents/
/home/yod/Documents/someotherfile

are saved correctly

I wonder if there is a way to specify the file and not lose the parents directories permissions.
Im using tar but I wouldn't mind using something else
 
Old 08-25-2020, 09:54 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,522

Rep: Reputation: Disabled
Maybe take a look at rsync.

https://linux.die.net/man/1/rsync
 
Old 08-26-2020, 03:13 AM   #3
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fatmac View Post
Maybe take a look at rsync.

https://linux.die.net/man/1/rsync
Thanks for the suggest but the problem with rsync is that I can't save the backup in a cloud, do you know if there is a way?
My plan was: make a shell/python script that creates a tarball and upload it in google drive through rclone and run the script periodically with a cronjob or systemd/Timers
 
Old 08-26-2020, 03:38 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Can you clarify your plans a little more? Any normal GNU/Linux-based VPS is going to have full Rsync support, so I would second the recommendation to use the Rsync protocol. However, if privacy or confidentiality is a factor then you will have to encrypt prior to uploading and that complicates things.
 
Old 08-26-2020, 07:32 AM   #5
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
Can you clarify your plans a little more? Any normal GNU/Linux-based VPS is going to have full Rsync support, so I would second the recommendation to use the Rsync protocol. However, if privacy or confidentiality is a factor then you will have to encrypt prior to uploading and that complicates things.

I don't have a server, I just want to backup some file of my OS. I can rsync to another hard disk but I prefer in a cloud to make it more available.
So when I format my OS, I just need to download it and extract. Thats what I was thinking.
 
Old 08-26-2020, 07:34 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Server is another name for "cloud". Can you please specify which one or ones you are planning for?

Most are rather weak in their offerings. However, as mentioned a plain old VPS will give you a lot for your money. Or you can use Rsync to save to a larger USB drive.
 
Old 08-26-2020, 07:51 AM   #7
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
Server is another name for "cloud". Can you please specify which one or ones you are planning for?

Most are rather weak in their offerings. However, as mentioned a plain old VPS will give you a lot for your money. Or you can use Rsync to save to a larger USB drive.
Yea I know that a cloud is a server, I thought you were saying I had to backup a server, sorry my english is bad.
Well, a VPS is a good choice but I don't want to pay for such a small thing. I have to backup mostly config files. Its a overkill
 
Old 08-26-2020, 10:16 AM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Use rsync to create a local backup directory, then copy that to the cloud...
 
Old 08-29-2020, 07:41 AM   #9
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Use rsync to create a local backup directory, then copy that to the cloud...
You mean copy the directory in the cloud instead of a tarball? Don't you lose permissions anyway?
 
  


Reply



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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
"Invalid tar magic" error msg. when I try to tar ldmud *.tar file in DSL pixxi451 Linux - Newbie 4 07-04-2010 08:32 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
How do I un tar a .tar, .tar.z, .tar.gz file vofkid Linux - Newbie 4 03-15-2002 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:50 AM.

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
Open Source Consulting | Domain Registration