How to Use the rsync Command to Transfer Files (Linux Crash Course Series)

Поделиться
HTML-код
  • Опубликовано: 30 янв 2025

Комментарии • 113

  • @Wandering_Horse
    @Wandering_Horse Год назад +12

    I have a server in LA, and when I am at school working on my coding, I can upload my work, go home download it, work on and upload it and have fresh code available all the time. Also prevents me from having to use the schools horrifically slow vpn. Also while the other kids are struggling to get there homework open in eclipse, I am already rocking my code in Vim on a remote server in LA!

    • @fullstackwithsantosh
      @fullstackwithsantosh 9 месяцев назад +6

      Wondering why are not already using git.

    • @adreto2978
      @adreto2978 7 дней назад

      @@fullstackwithsantoshgit is good for code but if you have many blob files like images of notes / graphs from textbooks then it quickly becomes inefficient space wise to use .git for tracking. Can sometimes nearly double the dir size

  • @cristoforopontikas
    @cristoforopontikas Год назад +21

    i would like to let you know something very useful to your guide. When you using the -a archive option you must be aware that using this include and preserve all those options (-r recursively, -p permissions, -t modifcation time, -l symlinks, -g group, -D devices) so you don't need to use the -r option as in your example when using the -a option. Hope this make the rysnc -a option more clear... thank you

  • @jim7smith
    @jim7smith Год назад +1

    Thanks so much for your linux series. I especially like the way you provide links in the ...more under the video so that we can have a TOC to help us find the desired content. Blessings on you and yours from the banks of the Suwannee River in North Florida.

  • @jebucaro
    @jebucaro Год назад

    ¡Gracias!

  • @KILLERTX95
    @KILLERTX95 Год назад +5

    I always use:
    Rsync -Pavh --dry-run blah blah
    Progress
    Archive
    Verbose
    Human readable
    Super useful

  • @ronaldronald8819
    @ronaldronald8819 Год назад

    rsync is an excellent tool and worth your while spending some time learning it's options.

  • @matteocassino3172
    @matteocassino3172 11 месяцев назад

    Easy to understand and very helpful. Thx!

  • @jasond.valentine5931
    @jasond.valentine5931 5 месяцев назад

    Thank you very much for this explanation. Concise and with examples. This is a great way to teach.

  • @CaptZenPetabyte
    @CaptZenPetabyte Год назад +1

    Thanks for this tutorial, it will become very useful I think ... I am ditching Wordpress and going back to static websites, and have decided I will simply update the files locally and rsync them to the website. Though having said that there are a few people that argue the ssh vs ftp and reliability issues, so I am still working some things out

  • @cbmeeks
    @cbmeeks Год назад +2

    Really loving your videos. I would like to see you do one on rclone as well.

  • @rcdenis1
    @rcdenis1 Год назад +5

    Rsync will resume tranfers if the link drops, with scp you'll have to start the transfer over in that case. Also, the OpenSSH folks declared scp deprecated a few years ago. Rsync -avP is how I use it.

  • @lawman2112
    @lawman2112 Год назад

    Loving the content here!! Thx!!!

  • @fvgoya
    @fvgoya Год назад +1

    16:50 Hey Jay, and how we can do a real sync? Is there a command for that?

  • @denalimike8159
    @denalimike8159 Год назад

    GREAT VIDEO! YOUR THE BEST! FROM DETROIT MI!

  • @PhilipBonev
    @PhilipBonev Год назад +1

    Thanks for the tutorial. I am working with linux for a long time now, but still I watch your basic tutorials there is always some little bit that surprise me. Little comment on the tutorial - I think 'command' is bash specific. Better use 'which' in my opinion.

  • @michaelcooper5490
    @michaelcooper5490 5 месяцев назад +1

    Hello Jay, Very good video thank you for this. I have a question How do I only sync the files that are different is that possible with a command syntax?

  • @davocc2405
    @davocc2405 Год назад +3

    In a practical sense RSYNC is sometimes over-used by some sysadmins - I remember it being used for large-group transfers (entire database filesets across 100mbit, we're talking instances of 40gig) and they were creating a huge overhead on the disk packs on both sides in one chunk. The database files were a mixture of some which changed heavily a a lot which didn't but every time you ran RSYNC with the checksum calculation the overhead on the disk was kinda wild. A later admin saw this and changed to a process where he created an MD5 checksum separately and worked out the files which had actually changed that needed to be replicated to the target; he then used RSYNC on only those files. To boot he had a checksum file which he could also transfer to the target to do a validation offline without involving the source system. This was on a shared SAN so disk utilisation spikes had to be considered, this method reduced peak demand quite a bit; the way they were using RSYNC before it was initially creating its internal block checksums on every single file every time (I think they didn't use the change date/time metric).
    This guy got me into checksum files as a standard practice and I've done them for everything - I archived data to several thousand DVD-R's and produced a checksum for each file set (burnt with the target files to disc) so when retrieved we could work out if there'd been any degradation or loss of files on the optical media. It's a bit of due diligence which can really save your arse especially if your processes are audited.

  • @PswACC
    @PswACC Год назад

    Excellent explanation. Thanks

  • @AustroPower
    @AustroPower Год назад +6

    Man Jay i am forever grateful and thanful for all the knlowledge and tuts you are dropping every week, i learned so much from you when it comes to Linux, i am now looking forward to buy your books :)🙏💯

  • @jonathanchevallier7046
    @jonathanchevallier7046 Год назад +3

    Very nice explanations. Thank you Jay. Do you use a program in particular for your markdown notes, or just a text editor ?

  • @OXIDE777-is6gs
    @OXIDE777-is6gs 7 месяцев назад

    Awesome video, thanks man!

  • @PaPaTheGMan1215
    @PaPaTheGMan1215 Год назад +1

    Thanks for the video. it is very informative. One question, how do you add a password to the destination address? Many of my systems have a password for access and don't have ssh keys. Thanks.

  • @gabriele8332
    @gabriele8332 Год назад +1

    Hello, can you also compare rsync with unison for file sync? Thank you.

  • @nathan445
    @nathan445 10 месяцев назад

    Awesome video! I'm going to try and use this to back up my Ubuntu Minecraft server to my WSL

  • @ChadsHobies
    @ChadsHobies Год назад +4

    Gentoo's Portage package manager uses rsync to synchronize your package list to the current in the repo. It also uses it when issuing commands with emerge to install packages. Rsync is an intragal part of the initial tool kit required for the installation of that distro. Rsync is really cool.

    • @wyfyj
      @wyfyj Год назад +1

      Another Gentoo enjoyer I see.

  • @dono42
    @dono42 Месяц назад +1

    FYI When using the -a argument you no longer need -r as it includes it (and some others).

  • @marioandresheviacavieres1923
    @marioandresheviacavieres1923 8 месяцев назад

    Thanks for another great one

  • @tigreonice2339
    @tigreonice2339 Год назад +1

    I've a question related with linux (not this vid): How to install fingerprint reader: U.ARE.U 4500 fingerprint reader Digital Persona, inc (crossmatch patented) on Linux mint? 😢
    Any way that works and is safe?

  • @readwriter
    @readwriter Год назад

    I have studied a lot about rsync recently!
    My simple use case is to maintain backups of files to an external attached drive.
    I was disappointed to see that in backing up from macOS to exFat, the metadata/resource fork stuff created by Mac (or some other cause) causes MANY unchanged files to be transferred again unnecessarily.
    I just saw a Reddit post that said, now, in macOS Ventura, inclusion of the standard “--modify-window=1” flag fails to be useful due to a kernel flaw.
    This topic is probably not substantial enough for a separate video, but I look forward to your comment.

  • @QuimChaos
    @QuimChaos Год назад +1

    Isn't the -a option (archive) the same as doing -rlptgoD ? if so the -r (recursive) option is not needed?

  • @mojoblues66
    @mojoblues66 Год назад

    8:54 What do you mean with "and DNS is often a problem" ???

  • @Handelsbilanzdefizit
    @Handelsbilanzdefizit Год назад +1

    If you do PXE Diskless-Boot, you have to transfer the entire Root-Directory to a remote system.
    What's the best way, to do this? So that no files go lost, because of access rights and other stuff.
    The only reliable way I found, is: Create a complete partitionimage "rootpartition.img" , and then mount it on the remote system.
    That's the only way that works for me.

  • @paullee107
    @paullee107 Год назад +2

    Oh cool- I'm glad you covered rsync. I'm an intermediate user, but you touched on an 'issue' that I just experienced on 16TB of backup data. I was using the --delete flag (and -av) for backing up my NAS drives... at some point the NAS went down, but my backup server kept diligently running its daily rsync. GASP, when I found all backup folders were EMPTY. --delete did what it does, and... poof. Any solution here? My local NAS mounts weren't present and I lost backup data. Is there a solution you might suggest while still using rsync?
    Second; I've been looking at borg-backup since that issue... I don't love it. Any other suggestions?
    Thanks!!

    • @shanent5793
      @shanent5793 Год назад +1

      You have to be careful with the design, it sounds like what you were doing wasn't really a backup at all. Any accidentally deleted file would have had at most one day of protection. There's no way around keeping multiple copies.
      For example you could rsync to a different destination directory each time. If bandwidth is limited, first make a copy of the destination, then rsync. Those are the safest ways, consuming a lot of redundant storage. Unfortunately doing anything too clever to save space is a risk. Filesystem-level deduplication or snapshotting are probably the lowest risk, or you could triage the data and reduce the retention accordingly. The risks are a bug in the filesystem or putting valuable data in the wrong retention level. Define some requirements and how you're going to evaluate them, choose your level of risk, keep some offline copies and test thoroughly

    • @paullee107
      @paullee107 Год назад

      @@shanent5793 I don't understand what yer saying.

  • @onknight
    @onknight 7 месяцев назад

    Is there a way to transfer files from an open media vault server to a Synology server?

  • @jamesbaxter2812
    @jamesbaxter2812 6 месяцев назад

    I got my RSYNC working. I am thinking. the cache file. I dont know if deleting it is good. But when RSYNC is done. Can it leave the cache alone.

  • @CDE.Hacker
    @CDE.Hacker Год назад +1

    Weird, everything I've read about backing up says to use rsync. But Syncthing seems to work so much better.
    I use it as a live backup or clone of my work files and do an off site backup periodically. It's mostly to protect against system or drive failures. If something goes wrong, a full up to date copy is always ready.
    What do you think?

    • @ultimatedjX
      @ultimatedjX Год назад +2

      It's because in reality rsync has old architecture, operates on a signle thread etc. It's a very popular tool and it's been there since... Always? When it comes down to syncing large amount of files or big ones, syncthing is going to be better in a lot of cases. There is a modernized version of rsync called rclone that is much more efficient and ready for nowadays workloads. PS: I use both syncthing and rclone (and rsync in the past).
      People tend to not write all over the Internet about their problems with rsync. They rather move to something else instead, like rclone which is very similar. This is how the legend of mighty rsync goes on and on :-)

  • @GooogleGoglee
    @GooogleGoglee Год назад

    How and where do you set that ssh banner message for every ssh connection to the server?

  • @luderetoplayistolive9824
    @luderetoplayistolive9824 4 месяца назад

    thank you for this!

  • @sandeepvk
    @sandeepvk Год назад

    I learned that I can *ls* the subdirectory using: ls/backup/notes. Never knew that.

  • @gwojcieszczuk
    @gwojcieszczuk Год назад +2

    One limitation with (-a) archive option is that it won't preserve ownership/group unless you're syncing to target as user "root".

    • @QuimChaos
      @QuimChaos Год назад +6

      or super user (SU/SUDO). -a is a group of flags that has the -o option that means: preserve owner (super-user only)

  • @vPeteWalker
    @vPeteWalker Год назад

    Thanks for the video! I gotta ask, where'd you get that shirt! I want one for my daughter and I! :) Much appreciated!

  • @littlenewton6
    @littlenewton6 Год назад

    Another rsync problem with multi hosts: I CANNOT use auto completion when I type the full path of destination! Each time I have to ssh to the destination host and pwd the full path, then copy and paste.

  • @mitchellpayne3674
    @mitchellpayne3674 Год назад

    Can you share your .md note files? Or is there somewhere you've already published them so we can look at them?

  • @peterjansen4826
    @peterjansen4826 Год назад

    I used rsync to clone my Arch-install from one SSD to another (faster). It was easy, just looking up the exact parameters on the wiki (I needed an extra one for VM's) and everything went well. All I had to do after that is install the bootloader again and I could boot on it.

  • @cybersekkin
    @cybersekkin Год назад

    the -a option includes the -r so when you added it, you can remove the -r as no longer necessary. The -avh --delete is so ingrained in my fingers (muscle memory) I have to pause when I want anything else and think about it.

  • @nairtana
    @nairtana 4 месяца назад

    Is it possible to use rsync to transfer files to Google Drive if I am signed in on Ubuntu?

  • @hansphung
    @hansphung Год назад +1

    May you share what Linux distro you’re using and the theme? Maybe not

    • @SlideRSB
      @SlideRSB Год назад

      I'm guessing Debian.

  • @websolutiontechnical
    @websolutiontechnical 5 месяцев назад

    helpful :) what if you have a file of a different user(other than joy) and having 700 permission. it will give permission denied even you run rsync using root. any solution for that?

  • @user-ji1rq6tq2p
    @user-ji1rq6tq2p 3 месяца назад

    Really need a simple program that mirrors 2 directories so I can have a backup and separate backup of the samething on my external drive! Please help

  • @sussusamogus7831
    @sussusamogus7831 Год назад

    great video

  • @lawman2112
    @lawman2112 Год назад

    I assume SAMBA is installed on both the source and target machines?

    • @deadlinerhorus
      @deadlinerhorus 10 месяцев назад

      smb client always is - at most distros while the server part has to be installed, that is correct.

  • @littlenewton6
    @littlenewton6 Год назад

    谢谢!Thank you for your tutorial. Now I use Rsync to do replication between two NAS. The only pity is that Rsync has no windows version.

    • @ironfist7789
      @ironfist7789 Год назад

      maybe you could use Windows Subsystem for Linux (WSL) but it might be a pain

    • @-aexc-
      @-aexc- Год назад

      ​@@ironfist7789wsl has extremely poor disk performance iirc

    • @ironfist7789
      @ironfist7789 Год назад

      @@-aexc- ah ok, that sucks

  • @ultimatedjX
    @ultimatedjX Год назад

    Rclone is so much better than rsync in any way... So many times I've been having problems with rsync's low transfer rates due to unknown reasons. It's an old software, guys. Rsync on the other hand does the same, is breeze to use, and didn't fail me even once!
    I imagine people still use rsync due to the habit mostly (like I did).
    An example of functional superiority of rclone: it has a buil-in mechanism for hashing ssh passwords of the hosts you want to sync with. Very handy.

  • @hmbird47
    @hmbird47 Год назад

    waiting for an episode about kill command 😁

  • @zinkzxd2891
    @zinkzxd2891 Год назад

    Cheers!

  • @camaycama7479
    @camaycama7479 Год назад

    The link for Akamai is missing

  • @spasha90
    @spasha90 Год назад

    $ command -v rsync -->> what is command in this??
    $ which rsync --->> usually this was used to check if it is installed.

  • @k.chriscaldwell4141
    @k.chriscaldwell4141 3 месяца назад

    Thank you.

  • @rhb.digital
    @rhb.digital Год назад +1

    Thanks.

  • @wiepcorbier
    @wiepcorbier 6 дней назад

    You can skip to 2:14 😅

  • @absmustang
    @absmustang Год назад

    Is that a rhel or Debian server?
    sorry, I didn’t catch that the first 20 times…😂
    Great tool, great video.

  • @RinksRides
    @RinksRides 2 месяца назад

    CONTENT starts at 2:30

  • @readwriter
    @readwriter Год назад +15

    Concerning the single-directional nature of rsync (without ‘delete’ flag), the *best* wording I saw to describe this is, “Rsync is ADDITIVE”

    • @jameswhite1910
      @jameswhite1910 Год назад +2

      Yes, seems an important distinction if one is looking for a .photoslibrary backup, for instance.

    • @mariozamora9684
      @mariozamora9684 Год назад +1

      For backup, yeah. But if you are migrating data from OS version 6 to OS version 8, you may want to preserve some of the new files generated on version 8.

    • @sureshkrishna3425
      @sureshkrishna3425 Год назад

      😊

    • @sureshkrishna3425
      @sureshkrishna3425 Год назад

      😊

    • @NuruislamMiah
      @NuruislamMiah Год назад

      BB❤ VP❤❤b❤❤​@@jameswhite1910

  • @squalazzo
    @squalazzo Год назад +1

    are you sharing that notes folder somewhere? interesting

  • @JohnnieWalkerGreen
    @JohnnieWalkerGreen Год назад

    I hate it whenever I forget to put a slash "/" at the end of the folder name.

  • @ChrisJackson-js8rd
    @ChrisJackson-js8rd 11 месяцев назад

    rsyncd.conf should be covered next time you return to this topic

  • @TheSecurityAgency
    @TheSecurityAgency Год назад

    Wow, a dry run, I can't even imagine what a "wet" would do, but it certainly gonna be a liquidfall?

  • @roadkill9173
    @roadkill9173 Год назад

    Are your notes published to the public?

  • @davidmutua6971
    @davidmutua6971 Год назад

    I use scp command for the same including the -r flag. Works same way. Don't see any difference Jay

  • @kazialireja262
    @kazialireja262 Год назад

    Kisuka dil jeet ka tum tumra hak adaya karna joga❤❤

  • @ArifKamaruzaman
    @ArifKamaruzaman Год назад

    Eyy Im fast af boi.

  • @WildeSelena-m1r
    @WildeSelena-m1r 3 месяца назад

    Schimmel Expressway

  • @HoltHugh-i1t
    @HoltHugh-i1t 4 месяца назад

    Schowalter Road

  • @RAYJOS
    @RAYJOS Год назад

    I haven't seen the difference between rsync and scp.

  • @GilbertJane-oq8nc
    @GilbertJane-oq8nc 3 месяца назад

    6492 Misty Square

  • @AngelaWalker-h4i
    @AngelaWalker-h4i 4 месяца назад

    Willard Shoals

  • @gauravkalpasi
    @gauravkalpasi Год назад +1

    First viewer

  • @AngelaGilkey-o7e
    @AngelaGilkey-o7e 4 месяца назад

    Hudson Street

  • @AntwanArzabala-u3y
    @AntwanArzabala-u3y 4 месяца назад

    Demetrius Corner

  • @FloydCeder
    @FloydCeder 3 месяца назад

    7911 Osinski Fall

  • @BarbaraLewis-q8i
    @BarbaraLewis-q8i 4 месяца назад

    Simonis Lock

  • @UlyssesTwomey-u8s
    @UlyssesTwomey-u8s 4 месяца назад

    Keven Highway

  • @AnthonyJacob-y5q
    @AnthonyJacob-y5q 4 месяца назад

    Rogelio Lodge

  • @kazialireja262
    @kazialireja262 Год назад

    Tumhumra pas sa kaya sikhsa
    Mila tumko etni jara bat ka liya
    Tum gio sisa ka umra gana sunna abhisa etna lachar aga baro dakho kaya hota hai❤❤

  • @KrisThornhill-l5h
    @KrisThornhill-l5h 4 месяца назад

    Prosacco Estates

  • @ZubairKhan-vs8fe
    @ZubairKhan-vs8fe Год назад

    Why do you need command lines in linux. That is so old days. Like using dos when you have windows

    • @SlideRSB
      @SlideRSB Год назад +2

      Because command lines are super leet

    • @johnbaines9580
      @johnbaines9580 Год назад +1

      If you are allergic to using the terminal there are GUI front-ends. It's linux - so you can choose!

    • @hpalvz
      @hpalvz Год назад

      Also... even Windows have a tool like this one! (robocopy)

    • @ZubairKhan-vs8fe
      @ZubairKhan-vs8fe Год назад +1

      Thanks thanks for explaining

    • @christianemden7637
      @christianemden7637 Год назад

      Also for the purpose of explaining rsync, using it on the terminal it becomes completely independent on what distribution you are running, the commands are always the same, and the output looks the same.

  • @BHUPENDRA._.JOGI9
    @BHUPENDRA._.JOGI9 Год назад

    😅😅9m
    😅9😅😅
    Nn
    KN
    nHistory HiKstory
    oion0lpm9
    9nnn
    899mm
    Nn
    Nnnnn😅.lmko

  • @FossWolf
    @FossWolf Год назад +1

    Hey this is a great video. rsync is a great tool and with argument -a
    -a, --archive
    This is equivalent to -rlptgoD. It is a quick way of saying you want recursion and want to preserve almost everything. :)

  • @Jorokusaki
    @Jorokusaki Год назад

    Which emulator do you use?