Use Rsync To Save Your Life

  Рет қаралды 10,392

The Linux Cast

The Linux Cast

Жыл бұрын

Here are the basics of how to use Rsync to back up your computer.
👇 PULL IT DOWN FOR THE GOOD STUFF 👇
Patreon - / thelinuxcast
Liberapay - liberapay.com/thelinuxcast/
KZbin - / @thelinuxcast
===== Follow us 🐧🐧 ======
Discord - / discord
Odysee - odysee.com/$/invite/@thelinux...
/ thelinuxcast
/ mtwb
Mastodon- fosstodon.org/@thelinuxcast
gitlab.com/thelinuxcast
Subscribe at thelinuxcast.org
Contact us email@thelinuxcast.org
Telegram Group - t.me/+9lYoIuLh0JIyMzcx
Amazon Wishlist - www.amazon.com/hz/wishlist/ls...
Merch Store - zaney.creator-spring.com/
Logo Courtesy of - pedropaulo.net
==== Special Thanks to Our Patrons! ====
thelinuxcast.org/patrons/
==== Referenced ====
#tut #rsync #thelinuxcast

Пікірлер: 57
@afroceltduck
@afroceltduck Жыл бұрын
One notable flag everyone should know is -n, which has rsync do a dry run (i.e. it doesn't actually do any copying or deleting, it shows you what would happen if you ran the command without that flag). Probably good to do it at least on your first run of the script so you can see if you made any mistakes in the destination or forgot to exclude something.
@Flackon
@Flackon Жыл бұрын
rsync already transfers only the deltas of the files to the destination (unless you're using a fresh destination directory every time, in which case it will obviously copy the entire file again). What the --delete option does is match the destination dir with the source dir by deleting files that are present in the destination but not in the source. You can also use --delete-before or --delete-after so this operation takes place respectively to the file sync For example if you're rsyncing a website's files, you probably want to use --delete-after so that the users don't bump into any missing files while you are copying stuff
@Miguel_GM
@Miguel_GM Жыл бұрын
A cleaner way to use --exclude: --exclude={"item1","item2","etc..."}
@topherfungus8424
@topherfungus8424 Жыл бұрын
You might find it easier to keep your excludes in a file and use the --exclude-from=$EXCLUDE option.
@Bruces-Eclectic-World
@Bruces-Eclectic-World Жыл бұрын
Awesome video Matt. I also add -h for human readable and the --progress, to see the file information like size and the like. I did a video called " Save the Music" showing a bit about my rsync script from Joe Collins. Yes that --delete switch is like the "dd" command, it will have everything deleted before ya know what is happening and it is way past to late to do anything so use with Caution! Thanks Matt! LLAP 🖖 One could use the --dry-run flag to test everything before doing the real thing... 🙂
@anon_y_mousse
@anon_y_mousse Жыл бұрын
Always a good idea to write a script for commonly used commands. That way you don't mistype things later on. I've got a bunch of those myself, ranging from just checking the CPU temperature to backing up all of my files. I also have a bunch of shell functions and variables I put into ~/.bash_aliases for doing daily tasks. My favorite is still `lrt` which does something akin to `ls -rt | tail` but with columns.
@burnt_666
@burnt_666 Жыл бұрын
my understanding of the --delete option is a little different. i'm fairly sure that it just deletes any files at the receiving directory that are not in the source directory. what you describe as it only transferring files that have been changed or added since the last sync i'm fairly sure is just the default functionality of rsync. i'm a bit new to this so i may be wrong, but that seems to be backed up based on a few different things i've read across the web.
@smotheredbyPrincessPeach
@smotheredbyPrincessPeach Жыл бұрын
@@squishy-tomato it does help get rid of system clutter and keeping your shizzle clean and up to date though.
@atom6_
@atom6_ Жыл бұрын
Exactly: it "syncs" including deleting if not existing at the source.
@OmarIskandarone
@OmarIskandarone Жыл бұрын
You are totally right
@bobpotter6430
@bobpotter6430 Жыл бұрын
Another important flag is -z, which compresses files for rsynching transfers to a remote destination (and decompresses them upon arrival). Saves a lot of network traffic. At my last job (network admin at a small college), I used a script called rsnapshot, which did (very granularly configuarable) scheduled backups of a substantial amount of system, faculty, staff, and student data in near real time. (The previously existing backup system would not complete before the next scheduled time, except overnight.) Saved a bunch of network resources, time, and backup media capacity.
@trevorflux1049
@trevorflux1049 Жыл бұрын
Another great video, dude. Thanks for sharing.
@darthkielbasa
@darthkielbasa 7 ай бұрын
Love you Matt. Finally gonna use rsync to backup nextcloud
@gavr1loo
@gavr1loo 9 ай бұрын
Good work man! Tnx!
@baruchben-david4196
@baruchben-david4196 Жыл бұрын
I was very diligent in backing up my data, did it often, stored them in several places (including off-site). Sadly, the backup program I used didn't properly restore, and the files it had created were so obscure I couldn't even find where the problem was.... So - check that you can restore. rsync works great in that regard. Finally found something that works, where I can restore as well as back up...
@kahnzo
@kahnzo 10 ай бұрын
Thank you.
@OcteractSG
@OcteractSG Жыл бұрын
I use rsync to back up /boot. /boot just is not covered by my BTRFS subvolumes. In fact, if you’re not using BTRFS, Timeshift uses rsync under the hood. I just do BTRFS manually (though with custom scripts) so that I have full control and full ability to leverage BTRFS for system recovery.
@Bob-1802
@Bob-1802 Жыл бұрын
I do the same. I have a small script with a menu calling Timeshift to --create --delete --list etc. and automatically do a "grub-mkconfig" so I can recover right from GRUB menu if need be.
@nevoyu
@nevoyu Жыл бұрын
I use btrfs-send to save and backup snapshots of my home directory.
@yramagicman675
@yramagicman675 Жыл бұрын
Btrfs is the best backup software I've had since time machine on MacOS 15 years old.
@davebean2886
@davebean2886 Жыл бұрын
I've found grsync useful to get started and easily helps get the paths
@npaladin2000
@npaladin2000 Жыл бұрын
Personally I prefer rclone in a lot of cases, especially for sending things offsite. But sometimes rsync works better, especially for larger files.
@smotheredbyPrincessPeach
@smotheredbyPrincessPeach Жыл бұрын
I do actually delete files every now and then and get annoyed when my system clutters with things I already tried to delete.
@Tech-Dev
@Tech-Dev 10 ай бұрын
Cheers
@VoltVandal
@VoltVandal Жыл бұрын
hi, nice video about one of the most important commands (utlis) ever. But what i did not really understand, is the explanation of the --delete flag. It just deletes files in destination folder as they are deleted in source folder, that's all. It has nothing to do with the incremental transfers, as rsync does this by default, w/o the --delete flag. thx for this vid.
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Yeah I'm really bad at explaining that command.
@jwisemanm
@jwisemanm Жыл бұрын
rsync with hardlinks is the best backup solution IMHO
@svenwindpassinger2170
@svenwindpassinger2170 9 ай бұрын
--delete What dose not exist in source, will be deleted in Destination. But be carful if you sychronize p.e. from HD and to the same Destination from an usb witch holds only a few of the files. Lets say you have hunderts files saved with rsync. Then you have a copy of one file with you on USB. After changing this file you want to synchronize only this one file from the USB - never use --delete - therefore you delete all files in your backup and hold only one file. So be careful and dry it out before with --dry-run together with - v for verbose. It sow you before what it will do. To delete the source after it saved, I believe you can use --remove-sorce-files. Greetings Sven
@LisandroCarmona
@LisandroCarmona Жыл бұрын
Matt, what is the difference into your "-a" and the "-A" on settings? By the way, what is "-rlptgoD (no -A,-X,-U,-N,-H)", it seems a futuristic language for me... --archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H) --acls, -A preserve ACLs (implies --perms) I would expect caps A for keeping the permissions (--perms).
@TheLinuxCast
@TheLinuxCast Жыл бұрын
so -a is an combination of several flags. Basically, -A is just one of those flags. You'd use -A if you just wanted to preserve permissions, and nothing else. -a also preserves symlinks and a while hose of other properties.
@manwe_sulimo
@manwe_sulimo Жыл бұрын
Dude, take a look at and do an episode on syncthing…
@Chris-ip8uv
@Chris-ip8uv Жыл бұрын
tar and rsync have always been my go to for minor backups. Full disk images are done with clonezilla
@ursodopudim
@ursodopudim 13 күн бұрын
I would like to use it to backup my whole OS to a external harddrive and then backup whenever I want, how can I do that? Just "rsync -av / /media/flashdrive" ?
@sopojarwo3483
@sopojarwo3483 Жыл бұрын
what different between --delete and -P?
@donaldmickunas8552
@donaldmickunas8552 Жыл бұрын
I should take another look at rsync. I am using rclone for my backups to pCloud. I got tired of their client messing things up. Rclone is a great way to access Dropbox type sites.
@TheLinuxCast
@TheLinuxCast Жыл бұрын
I might have to look at that because I use pcloud too.
@keithmcgavin5396
@keithmcgavin5396 Жыл бұрын
@@TheLinuxCast Would be worth it Matt. There are few videos about on rclone. Chris Titus has done one but it was a bit rushed and difficult to follow without reference to the documentation on the rclone website to track down how he configured the cloud backend to encrypt files. One useful feature of rclone is that it can mount the cloud filesystem as a local directory.
@wyfyj
@wyfyj Жыл бұрын
Would you set up a local NAS?
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Someday that'd be nice
@feelsbad1193
@feelsbad1193 Жыл бұрын
So you do not like timeshift? Not using BTRFS?
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Fedora uses some odd subvolume layout which timeshift doesn't like.
@feelsbad1193
@feelsbad1193 Жыл бұрын
@@TheLinuxCast Yeah it's a pain in the arse just to get it to work right. All because of @ causing problems. Ever thought about making a video getting Timeshift to work right on Fedora? I know you love Rsync, but something many do not know to get snapshots to work right.
@TheLinuxCast
@TheLinuxCast Жыл бұрын
@@feelsbad1193 I'm going to do some btrfs videos, I've just not decided on how to do them.
@Gurj101
@Gurj101 Жыл бұрын
@@TheLinuxCast oh there is my answer. Interesting, sk can't fadora devs patch it or do timeshift devs have to work for a new requirement 🤔
@Gurj101
@Gurj101 Жыл бұрын
isn't using a gui like timeshift way easier ? it just runs rsync right....
@vanadium4167
@vanadium4167 Жыл бұрын
rsync -av --delete /source /destination may be considered way more easy by some. Moreover, timeshift is as such not designed as a backup tool for user data.
@itsfish8672
@itsfish8672 Жыл бұрын
GVM.
@funnynews341
@funnynews341 Жыл бұрын
Can you make a video how to use your dotfile for install new linux. Like i want to install minimun debian with your i3 and other config? Thank you so much
@drumpf4all
@drumpf4all Жыл бұрын
If you like rsync, you’ll like Rclone as well. Rclone Is the rsync for cloud storage. YW!!
@VE64RD
@VE64RD Жыл бұрын
After fedora 34 it stopped working.
@TheLinuxCast
@TheLinuxCast Жыл бұрын
Rsync works for me on 36 or did you mean something else?
@mrbaba4355
@mrbaba4355 Жыл бұрын
Hello Matt youtube have done it again! One of our community members :switch to Linux has been banned from KZbin for promoting media players. Please spread the word,🙏
@sunriseleatherco.6587
@sunriseleatherco.6587 Жыл бұрын
SwitchedtoLinux seems to be still there? I can access his videos.
@mrbaba4355
@mrbaba4355 Жыл бұрын
@@sunriseleatherco.6587 He can't upload videos he got a strike
@sanjeev2003
@sanjeev2003 Жыл бұрын
Do you have pcloud? Liking it? Planning to host ripped movies. Would that be good?
@CyperN077
@CyperN077 Жыл бұрын
Matt I went so far as to alias cp to rsync -auh --progress.
@Chris-ip8uv
@Chris-ip8uv Жыл бұрын
Now that is an interesting way to use it
Customizing i3Blocks For the Ultimate Status Bar on i3WM
27:23
The Linux Cast
Рет қаралды 31 М.
How To Backup Your Computer - Tips and Tricks
23:39
The Linux Cast
Рет қаралды 6 М.
Самый Молодой Актёр Без Оскара 😂
00:13
Глеб Рандалайнен
Рет қаралды 11 МЛН
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 25 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 123 МЛН
Make Your Life Easier and Learn These Things
13:49
The Linux Cast
Рет қаралды 7 М.
How to Use rsync to Reliably Copy Files Fast (many examples)
22:06
Tony Teaches Tech
Рет қаралды 29 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,2 МЛН
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 97 М.
5 Things To Know About the Linux File System
14:07
The Linux Cast
Рет қаралды 6 М.
rsync | The most powerful backup tool you're not using
28:00
Nielsen Networking
Рет қаралды 5 М.
5 BEST Ways to Manage Flatpaks
11:54
The Linux Cast
Рет қаралды 13 М.
Sync Files Across All Your Devices With Syncthing
10:48
DistroTube
Рет қаралды 37 М.
I Used Debian 12 For 5 Months - Long Term Review
46:13
The Linux Cast
Рет қаралды 108 М.
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 7 МЛН
S24 Ultra and IPhone 14 Pro Max telephoto shooting comparison #shorts
0:15
Photographer Army
Рет қаралды 9 МЛН
ВАЖНО! Не проверяйте на своем iPhone после установки на экран!
0:19
ГЛАЗУРЬ СТЕКЛО для iPhone и аксессуары OTU
Рет қаралды 6 МЛН