[SOLVED] could someone "please" check 2 rsync commands I'm not sure the structure is right.
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
could someone "please" check 2 rsync commands I'm not sure the structure is right.
I've been working on this for 2 weeks, I'd like someone that knows what they are doing with rsync to tell me if this should work on my Ubuntu 18.04 machines.
This works great, for making a backup and keeping it in sync exactly as it is on the server, same permissions and everything, I figured this out a couple years ago, it has worked perfect.
sudo rsync -r -t -p -o -g -v --progress --delete -l -H -D -s /mnt /media/jason/USB Backup/Backup I noticed the format is sudo rsync options /source /target
I Modified the rsync commands I found on the internet below, I noticed that these have the / as the source directory in the middle of the options, or do I need to move that towards the end right before the destination directory ? this is why rsync is confusing so far, everyone seems to do it a little different, should these work ?
this one to backup my laptop:
sudo rsync -aAXv / --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found",”swapfile”,”.encryptfs”} /target
This one to help me turn my server into a virtual server, by copying the following to the guest HDD with a fresh ubuntu 18.04 install on my kvm server:
sudo rsync -auHxv / --exclude={"/etc/fstab*","/etc/network/*","/proc/*","/tmp/*","/sys/*","/dev/*","/mnt/*","/boot/*","/root/*",”swapfile”,"/lost+found"} /target
The people putting these on the internet seemed confident, but I'm not sure the structure is right since the --exclude is after the / source directory.
The source does go right before the destination in my case, I believe the directions I got above was for using the command for backing up through ssh, which apparently you can enter the source in earlier in the command, then the ssh:/* goes right before the destination if I understand what I found out today correctly.
However, if you'd like to pass options to the SSH client then you would still need to have the -e option for rsync. That would come in handy if you have a different account name on the remote computer or will use a key to connect:
Thanks for the code, as it was the next script I needed to figure out. Once I get everything transferred over, Since my 4TB backup USB is running out of space. I planned on using my old server for a backup server and would then need to transfer ( 8TB LVM to 8TB LVM "For Now") with rsync and ssh, rsync is the fastest way of backing up that I've come across.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.