LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-10-2024, 11:14 AM   #31
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,816

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493

Quote:
Originally Posted by maybeJosiah View Post
Just looked up again and yes, all I need to record extra is permissions and executability. I already have all timestamps. With that I think this is what to use.
Code:
sudo rsync -vrlDAXHxog --progress --delete --open-noatime --exclude='(USB at)' (like '/' but not) (copy to directory)
-A implies --perms. -E preserves the executability when --perms is not enabled. If --perms is enabled, this option is ignored.
Sorry, no use for your extra records of permissions/executability.

Quote:
Originally Posted by IsaacKuo View Post
Code:
rsync -vaxHAX --delete --progress --exclude home/kuo/.cache /mnt/sda1/* /mnt/sdc1/
The only real difference between -vrlDAXHxog and -vaxHAX is that the latter preserves mtime. But for some reason you want to set it yourself.
 
1 members found this post helpful.
Old 01-10-2024, 11:14 AM   #32
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by maybeJosiah View Post
Oops, it was /mnt/... not as I said, sorry. X E.
As far as the OS is concerned /mnt/ is just some random normal directory. There's nothing special about it, and you can stuff it with whatever you want.

But by convention, it's a popular place to stick mount points. No special reason or benefit to putting them there.

Once upon a time, /mnt was used for mount points for removable media like floppies and CDs. But the proliferation of USB thumb drives made this increasingly confusing so they decided to move this stuff to /media.

That just left /mnt as a boring directory, so the only stuff that ever showed up there was manually put there.
 
Old 01-10-2024, 11:34 AM   #33
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 487

Rep: Reputation: 180Reputation: 180
Quote:
/media... That just left /mnt as a boring directory,...
I always create a /mnt/usbdrive directory there. Then when I attach a USB backup drive, I always manually mount it to /mnt/usbdrive. That way none of my scripts have to change when I run external backups. I personally dislike the /media/ concept, but at least I can get around it when I need to.

FWIW, -av --delete options to rsync are the only ones I've ever needed to backup my data to a linux formatted drive (say ext4).
 
Old 01-10-2024, 12:33 PM   #34
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
I just like to be safe with backups. No losing stuff. Thank you all, especially IsaacKuo. Also, I try to store as little as possible so that thing about -A and --perms is good. If I ever have like a credits thing for a backup program that uses this, would anyone like to specify any more than user name to acknowledge? Like my email is maybejosiah@aol.com if you want a private message. X E.
 
Old 01-10-2024, 02:34 PM   #35
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 487

Rep: Reputation: 180Reputation: 180
Actually -a (--archive) equals -rlptgoD. Notice -p (--perms). Therefore if you use -a you already have --perms. Never used -A as don't use ACLs. In fact I had to just look them up to see why even present in Linux as owner/group/public seemed quite adequate for access control.
 
Old 01-10-2024, 04:15 PM   #36
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
Thanks rclark, I was going to say that after reading rsync --help again but anyway did not get around to it. X E.
 
Old 01-11-2024, 10:04 AM   #37
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
I found that IsaacKuo command does almost what like mine does. All I would add is "E". I read rsync --help again and could not find E included in -aAxXHv. Also, unsure if I should try to use rsync on that drive to back up or like my 22.04.2 desktop bootable USB flash drive version of rsync. That especially upon restore. I know how to get where rsync is. I am unsure if by default I would be using rsync on that drive or which rsync I would be using if I am in terminal at that drive. Obviously end all from directories with /. X E.
 
Old 01-11-2024, 10:46 AM   #38
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,816

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
Quote:
Originally Posted by maybeJosiah View Post
I read rsync --help again and could not find E included in -aAxXHv.
Quote:
Originally Posted by Petri Kaukasoina View Post
-A implies --perms. -E preserves the executability when --perms is not enabled. If --perms is enabled, this option is ignored.
Let me shake your world: you can find all the info you need from the man page:
Code:
man rsync
 
1 members found this post helpful.
Old 01-11-2024, 11:59 AM   #39
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
Okay, I read that "man rsync", so "E" is disabled if "--perms" is but I am unsure if executability is still preserved. I guess I will just include it even if it is ignored because it never said --perms preserves executability. Is there any way you know of I could preserve executability or do I need to record a file to save it? Also, is that "man rsync" online or on device and if it is on device, can I remove stuff like that? No need to answer about "man rsync", just executability. Many of like my desktop things are executable so that is one thing I would prefer to preserve. That and timestamps. Timestamps I may need to store all of because setting some with debugfs may affect others. X E.
 
Old 01-11-2024, 12:22 PM   #40
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
-A, --perms, and -E all preserve executability.

-A includes --perms, which includes -E.
 
Old 01-11-2024, 12:37 PM   #41
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,816

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
Quote:
Originally Posted by maybeJosiah View Post
"E" is disabled if "--perms" is but I am unsure if executability is still preserved.
Yes, it is preserved: executability is only a subset of permissions. When permissions are copied, it includes read, write, exec for user, group, others.
Quote:
Also, is that "man rsync" online or on device and if it is on device, can I remove stuff like that?
Man pages are on your machine: file /usr/man/man1/rsync.1.gz or similar. 'locate rsync.1' should find it.
Quote:
Timestamps I may need to store all of because setting some with debugfs may affect others.
Only mtime is needed. And it is preserved with 'rsync -a' as everything else which matters.
 
Old 01-11-2024, 12:45 PM   #42
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
Can you point me to some documentation that says executability is a subset of permissions? Also, call me sentimental but I prefer all timestamps, even if they do not normally matter. X E.
 
Old 01-11-2024, 12:52 PM   #43
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195

Original Poster
Blog Entries: 2

Rep: Reputation: 5
Okay, I take your word and like my research's word on that executability thing. Solved but I am still unsure whether I should specify where rsync is on like my main drive for backup or restore. X E.
 
Old 01-11-2024, 12:53 PM   #44
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,816

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
Quote:
Originally Posted by maybeJosiah View Post
Can you point me to some documentation that says executability is a subset of permissions?
Everything is in the man pages (usually):
Code:
man chmod
 
Old 01-11-2024, 12:57 PM   #45
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,816

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
Quote:
Originally Posted by maybeJosiah View Post
I am still unsure whether I should specify where rsync is on like my main drive for backup or restore.
It's up to you. Plain 'rsync' is enough but you can also specify the path. Maybe it's /usr/bin/rsync. 'whereis rsync' or 'which rsync' will tell.
 
  


Reply

Tags
backup, command line, restore, rsync, usb



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
media, ex: floppy disk, HDD short life span, forget how to use; preservation rico001 Linux - General 1 05-29-2021 03:17 PM
Making mirrow using mkraid with preservation information on one of the disks. Shakin_Aleksey Linux - Server 1 07-24-2011 10:21 PM
Searching for an appropriate Interprocess communication with data preservation Esika Programming 2 06-06-2011 05:07 AM
Debian / Ubuntu : Config File Preservation and Merging? tinyTux Debian 2 03-22-2011 11:19 AM
AIX 4.3.3 Preservation Install ajoshay9 Linux - Software 0 12-01-2003 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:58 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