Linux Backup with TAR and Cron Jobs

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • Info
    Level: Intermediate
    Presenter: Eli the Computer Guy
    Date Created: September 21, 2010
    Length of Class: 35 Minutes
    Tracks
    Linux
    Prerequisites
    Introduction to Linux
    Installing Linux
    Basic Linux Tasks
    VIM for File Editing
    Navigation in Linux
    Users, Groups and Permissions in Linux
    Purpose of Class
    This class teaches students how to backup directories using TAR, and demonstrates how to schedule tasks using Cron Jobs.
    Topics Covered
    Backing Up Directories with TAR
    Recovering Directories with TAR
    Setting Up Cron Jobs for Scheduled Tasks
    Class Notes
    Backup Using TAR
    Backup = sudo tar --cvpzf backup.taz.gz --exclude/=directory (recursive) PATH
    --c = create new file (overwrites old file)
    --v = verbose
    --p = preserve permissions
    --z = compress
    --f = filename (very important)
    --exclude=DIRCECTORY is Recursive
    Naming Files with time = filename-$(date +%F-%T)
    Recover Files from a TAR File
    Recover = sudo tar --xvpzf FILE --C /DIRECTORY
    Capital -C = change to directory
    -x = extract
    Cron Jobs
    To Edit the Crontab File = sudo cron --e (first time it will ask you your default editor)
    Format = minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
    * Wildcard for Every Minute/Day/Hour/Month?Day of Week
    Example to Backup Entire Server for 1am Every Morning = 0 1 * * * sudo tar -cvpzf /backup.tar.gz --exclude=/mnt /
  • Věda a technologie

Komentáře • 227

  • @juliotalavera07
    @juliotalavera07 Před 9 lety +9

    Eli is the first source of information when I want to learn something new or just review things I have not worked with in a while. He is clear, easy to understand and the material he uses to show you something is easy to get.

  • @hipman87
    @hipman87 Před 7 lety

    I just went through your whole Linux course tonight, massively appreciated, very clearly presented.

  • @gregjachtoma6490
    @gregjachtoma6490 Před 7 lety

    Einstein said that any intelligent fool can make things bigger, more complex.
    But it takes a touch of genius and lots of courage to move something in the opposite direction.
    Thank You for this tutorial

  • @stephenjasonwang
    @stephenjasonwang Před 11 lety +1

    Can't wait for tom to watch this so i'm watching it now... watched your whole Linux class straight and i loved it.. THANKS ALOT!

  • @REDCAES
    @REDCAES Před 9 lety

    Thx Eli you are the bomb!! I've watched about 35 of your videos so far and haven't been disappointed yet, thanks for making it easy to grasp!

  • @arasonsuresh1042
    @arasonsuresh1042 Před 8 lety

    Thank you so much for making Linux so simple to understand. You are the best teacher ever! I watched all the 9 videos from introduction to the end, every class was very easy to understand and I would be glad to watch all your classes. You just earned a subscriber.

  • @songsanams6355
    @songsanams6355 Před 2 lety

    you are a star after this many years, no one has such a great description

  • @MrHav1k
    @MrHav1k Před 10 lety +9

    Eli you have by far the best tutorials on CZcams! I've learned so much from these linux videos and I love how you focus on what matters!

  • @mazdysoraya6121
    @mazdysoraya6121 Před 11 lety

    what a king you are! That is how things should be explained. I run into many tutorailas that skip points that make people confusing..Thank you

  • @yanxiang1987
    @yanxiang1987 Před 8 lety

    Thanks Eli for your patient and clear class. I learned a lot from you.

  • @GaryCameron780
    @GaryCameron780 Před 2 lety

    Watching in 2022. Eleven years later this is still very useful. thank you.

  • @niaei
    @niaei Před 10 lety +6

    Two questions:
    1) How to exclude more than one path?
    Like: I don't want to keep /mnt and /media and /tmp
    2) How to create a backup file for more than one path?
    Like: I want to create an archive file, and I want it to include /usr/share and /bin and /var/www.
    BWT sir, you're awesome.
    Keep do this. :)

    • @oliverwyatt236
      @oliverwyatt236 Před 4 lety

      tar -xvpzf your_backup.tar.gz --exclude={"/home/*/Downloads/","/home/*/Documents"}

  • @rimmiloud
    @rimmiloud Před 10 lety +6

    Excellent Teacher I have seen in my life Since I started the school on 1978

  • @GrantTurnerMusic
    @GrantTurnerMusic Před 12 lety

    Great instruction. Just moved a website to a dedicated server and plan on using this to perform backups. Thanks dude!

  • @telao492
    @telao492 Před 2 lety

    I wish I would have found you weeks ago! Thank you for explaining this down to the meaning of each character. Much appreciated!

  • @prabeshines
    @prabeshines Před 11 lety

    wOw!!!!!!
    I never thought I would learn Linux this fast.... 2 Days and i know hell lot of things....
    .
    THUMBS UP ELI !!!! U R AWESOME

  • @sandhyasingh7356
    @sandhyasingh7356 Před 7 lety

    you made my life a lot easier with this video.....keep posting these kind of videos...you are too good in teaching eli

  • @ernestoearlsalunat3785

    Awesome job Eli! I had so much fun and boosted my confidence. Cheers!

  • @vsworld7757
    @vsworld7757 Před 9 lety

    Best Video, your narration is too good to keep track of and your recap actually makes it hard to forget! Thank you soo much! Look forward for more videos :)

  • @liketocode
    @liketocode Před 10 lety +5

    Love your videos - educational while entertaing :)

  • @lvscan
    @lvscan Před 10 lety +1

    Excellent Video. Thanks for helping me understand Linux a little better!

  • @Bubblegan
    @Bubblegan Před 7 lety

    Fantastic tutorial. I am so happy that I found your channel. Keep up the great work.

  • @kewlbeans9905
    @kewlbeans9905 Před 10 lety +1

    Thank you kind brother. You are a gentleman and a scholar.

  • @ClickJCOnline
    @ClickJCOnline Před 13 lety

    Eli,
    Great video. Very instructional and informative to both the expert and the person just beginning. Will look forward to more tutorials.
    Jeff

  • @djsensacion7
    @djsensacion7 Před 8 lety +1

    Thank you for the detailed explanations of it all.

  • @serverguy276
    @serverguy276 Před 8 lety

    Eli, you are great, nice video and presentation. I enjoy watching all of your video.

  • @calingiurgiu2000
    @calingiurgiu2000 Před 10 lety

    God bless you Eli! Your videos are lifesavers! Thank you ! I wish I could replace my current teacher with you.

  • @Rchauhan902
    @Rchauhan902 Před 8 lety

    thank you sir for your valuable videos. I learned lots of thing from basic to advance from your tutorials.
    thanks a lot

  • @SwingingInTheHood
    @SwingingInTheHood Před 3 lety

    Here we are, some 10 years later, and THIS is still the best way I could find to back up my Linux systems (maintaining permissions and symlinks) to a NFS mounted NAS drive and AWS S3 bucket.

  • @208dharma
    @208dharma Před 8 lety

    Thank you for your efforts to share your knowledge to everyone who wants. These are very helpful me.

  • @jimfurman3145
    @jimfurman3145 Před 6 lety

    Awesome I was searching for a linux backup program .... but this is so simple ... thanks!

  • @jeanettemartinez892
    @jeanettemartinez892 Před 4 lety

    Best video yet, you saved my brain thank you!

  • @mr_gumball
    @mr_gumball Před 7 lety

    OMG, Thank you. This is the one of the most useful tut

  • @eventhorizon1306
    @eventhorizon1306 Před 6 lety

    Great series...Thank you Eli.

  • @prashanthb6521
    @prashanthb6521 Před 2 lety

    This was so well explained. Thanks a lot ETCG.

  • @shikhavyaghra8969
    @shikhavyaghra8969 Před 7 lety

    Thanks for the video....I was struggling with this.This video helped me to solve my problem.

  • @ChrisLCBoston
    @ChrisLCBoston Před 10 lety

    Excellent video again!!

  • @KalishAlexander
    @KalishAlexander Před 9 lety

    thanks a lot, your lessons are very informative and useful.

  • @DavidJKoch
    @DavidJKoch Před 10 lety

    Excellent tutorial series on Ubuntu Linux !

  • @Axel-rs3cg
    @Axel-rs3cg Před rokem

    appreciate your videos lessons and logical well expressed manner 👍

  • @morningstars123
    @morningstars123 Před 12 lety

    thanks.. Happy to say u are my Linux teacher ..

  • @elithecomputerguy
    @elithecomputerguy  Před 13 lety

    You can backup /
    If you need a bare metal backup you can just use a piece of backup software.

  • @lalitpnwr
    @lalitpnwr Před 11 lety

    Eli you are a awesome teacher

  • @jkupas
    @jkupas Před 11 lety

    Thanks a lot, you can explain amazingly simple.

  • @iliketobathify
    @iliketobathify Před 7 lety

    Nano is an excellent editor for those finding Vim too difficult.

  • @reddysekhar0072000
    @reddysekhar0072000 Před 6 lety

    tq eli, u r making my life easy

  • @aplifiedchaos
    @aplifiedchaos Před 4 lety

    Many thanks buddy. You got yourself a subscriber

  • @thetlwintint
    @thetlwintint Před 11 lety

    thank you very much. You are a really great trainer.

  • @dai7169
    @dai7169 Před 4 lety

    Thanks a lot Eli

  • @FranseFrikandel
    @FranseFrikandel Před 11 lety

    Yes you can, everything you can do with the server can be done with the desktop using the terminal

  • @gps6167
    @gps6167 Před 12 lety

    Awesome !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @PratapKanhed
    @PratapKanhed Před 8 lety

    Thanks for All lectures

  • @shayaanmandal3917
    @shayaanmandal3917 Před 5 lety

    Still so much powerful videos

  • @ciscomind626
    @ciscomind626 Před 8 lety

    I like Your Channel So much You are the best teacher i ever had !
    You are amazing Guy Too bad I can't join you in real Classroom With my laptop :)
    have a nice Day Greeting from Algeria

  • @EliotPearson
    @EliotPearson Před 12 lety

    Solid overview Eli.

  • @vdenim86
    @vdenim86 Před 12 lety

    whole day i had struggled and got this video thank u very much , please some video of apache and mysql thanks eli

  • @BornWithLegend
    @BornWithLegend Před 7 lety

    superb sir thanks for upload

  • @nachoherranz1240
    @nachoherranz1240 Před 10 lety

    Great teacher

  • @Waldi111979
    @Waldi111979 Před 11 lety

    hi Eli, I have an idea for part two of this tutorial - I intend to do backup of my system, so that once it will get corrupt (after update/upgrade), I could go back to previous working Linux before corruption of the system.
    That's something I am missing in this tutorial.
    BTW - your tutorials are amazing! I've seen around 20 to date and they are so easy to understand! thank you for sharing with your knowledge with us publicly. cheers!

  • @patlab555
    @patlab555 Před 6 lety

    Woow AWESOME course!
    You are taking time explaining every single thing, + you are speaking at a perfect pace for a non-native English speaker
    Thumb up + Subscribed
    Are the 19 who disliked your video, tried it on Windows?

  • @mehretabayalew3890
    @mehretabayalew3890 Před 4 lety

    Great tut!

  • @Grezic
    @Grezic Před 12 lety

    IT's very easy to understand, thanks very much.

  • @JamesSamples
    @JamesSamples Před 3 lety +1

    LOL, Dang it ELI!!!
    I watched this video trying to remember if its:
    ....--exclude=/mnt.... or
    ....--exclude = /mnt... with spaces
    Eli: "I'm not going to exclude anything, just to make life easier..."
    LOL that was funny

  • @BrianThomas
    @BrianThomas Před 8 lety +1

    Great video. Question. What if you wanted to transmit that backup off site to another Linux machine on a schedule? How would you do that?

  • @ganimikawa
    @ganimikawa Před 9 lety

    Great video...

  • @explosivo3065
    @explosivo3065 Před 4 lety

    This video helped me a lot
    Thanks !!!

  • @NelsonFilipeCosta23
    @NelsonFilipeCosta23 Před 11 lety

    u make my day :) ty alot

  • @abhisheksingh-ih1eo
    @abhisheksingh-ih1eo Před 3 lety

    You are awesome sir

  • @455rocks
    @455rocks Před 9 lety +8

    Sir,can you please do a video on Shell scripting(Bash and Perl)?

  • @ldean97
    @ldean97 Před 5 lety

    Hey Eli I have a question, im running linux mint 19 and I was wanting to add a custom desktop environment from the web, ive already got the file and its a .tar.gz but I cant figure out how to add it

  • @arunmohan1211
    @arunmohan1211 Před 7 lety

    usefull...superb

  • @youcef2128
    @youcef2128 Před 12 lety

    thank u so much ur amazing and awsome for averyone intersted

  • @NiamulArifin
    @NiamulArifin Před 10 lety

    thanks for sharing !!!

  • @amabowilli
    @amabowilli Před 8 lety

    Eli, I love your tutorials and how much you simplify them. Can you make a video on red hat or Centos kick-start? i mean the distribution doesn't matter if its a Linux kick start.

  • @IvarsRuza
    @IvarsRuza Před 9 lety

    There is lot more to tell about tar. t - option/switch/argument for me is the sugar when I use tar . Width a "t" option/switch/argument You can look inside tar archive :) Also its possible to extract one file after You had a look with a "t" option. About sudo - I belive Eli has configured sudo to be used without a password for certain non authoritative user to operate with system as a root. It's wrong - sudo loses the concept why it was made :) Also using sudo in cron - it's wrong for most of us, in case of Eli - as I said, I believe he has made one non authoritative user to be used without password. Also - sudo - it is not in all Linux flavours / distributions. Eli I would enchant this video course. But!!! Even for me it was great to listen - You are great orator. Good Job.

  • @ramireddypoli8873
    @ramireddypoli8873 Před 8 lety

    thank u
    i saw ur videos
    it helps mee...
    thank u

  • @ZXCY00
    @ZXCY00 Před 10 lety

    Thanks, I used tar in the past for backups but couldn't do it right. All good now. Is it possible to encrypt the backups with tar?

  • @Ajitsingh-gc5ej
    @Ajitsingh-gc5ej Před 11 lety

    hey eli ...gr8 job man .!!! please upload more video of servers like ftp, samba, dns, nfs. thnx alot again

  • @foreman608
    @foreman608 Před 11 lety

    Thank you !!!

  • @fabriziodutto7508
    @fabriziodutto7508 Před 4 lety

    All very good! Except using wordpress :-) Thank you for sharing! Just wanna add that performing the tar -c.. command is NOT adding new nor updating old files inside the tar.gz file, every time it overwrite them, just take it into consideration! Also you can recover a single file from the tar, by using the --file option.

  • @Cosmogh
    @Cosmogh Před 6 lety

    THANKS VERY MUCH

  • @andreymosienko6227
    @andreymosienko6227 Před 8 lety

    Hi Eli. Thank you for really helpful course. Excellent presentation of the material.

  • @hzlike
    @hzlike Před 10 lety

    thank you for this share

  • @mikeonthecomputer
    @mikeonthecomputer Před 8 lety +2

    -p only matters on the extraction mode (tar -x). It makes no difference on create mode (tar -c).

  • @RC-Heli835
    @RC-Heli835 Před 6 lety

    Iv'e seen where folks recommend backing up / in Arch linux HD install from live cd being chrooted into the installed system. Is that what you do or does it only matter on Arch? Thanks for all your helpful videos!

  • @srinivasachakradhar2442

    Your awesome ....

  • @GeorgeLathem
    @GeorgeLathem Před 6 lety

    I miss this Eli

  • @geekfromthehills
    @geekfromthehills Před 11 lety

    grt job eli..

  • @gmc9753
    @gmc9753 Před 11 lety

    Linux has a very helpful command called "file". This command can tell you what a file contains based on the contents of the file. It can tell you that a file is a compressed file, tar file, mp3 file, python file, etc. etc. So if you do create a compressed tar file called "Bob", you can identify it years later!

  • @Kreosification
    @Kreosification Před 12 lety

    It depends on what you want to compress. Video/Audio/Image files aren't really cut for compressing. Text-Files profit the most probably.

  • @malikhaider366
    @malikhaider366 Před 11 lety

    *** 5 STAR *** for you as always ...

  • @kousoulides
    @kousoulides Před 11 lety

    if I type sudo tar -c in my macs terminal will it start backing up everything?? where?

  • @subbuvenki6607
    @subbuvenki6607 Před 9 lety

    nice work

  • @JnCrlsHrnndz
    @JnCrlsHrnndz Před 7 lety

    You look like Guillermo from the the tv show weeds
    But thanks, this is very well explained and helpfull.

  • @baldeousmanedade4462
    @baldeousmanedade4462 Před 8 lety +1

    Good morning, Mr. foremost of all I thank you for your excellent tutorials. So I want a proxy to block sites on Linux and if you have an idea I really need your help thank you

  • @poojatiwari1466
    @poojatiwari1466 Před 7 lety

    really helpful

  • @Kreosification
    @Kreosification Před 12 lety

    Parameters can always be mixed for example ls doesn't care if you type "ls -RQ1" or "ls -1QR" :)

  • @user-tq6my4sx1g
    @user-tq6my4sx1g Před 10 lety

    awesome

  • @JackDD
    @JackDD Před 8 lety +1

    Is there any reason to use tar over rsync for regular backups?

    • @bdf2718
      @bdf2718 Před 7 lety +1

      Two reasons.
      1) You need to archive to tape. I mean *really* need to. Not _want_ to because that's how you've always done it, but _need_ to because an rsync to disk won't cut it (because you're the NSA and archiving vast quantities of data forever so it has to be to tape).
      2) You've never heard of rsync and therefore tar is the only backup tool you know of.
      That's it. Those are the only two reasons, and number 2 is dubious (but appears to be why this guy is using it).
      Rsync isn't just for backups. Two of the companies I've worked for used ftp (gah) to push tarballs to web servers then unpack them on the servers. And usually there were only minor changes to one or two files, but keeping track of what's changed and pushing only those files over is tedious and error-prone. But the tar-ftp-untar cycle is *slow*, especially if your company is out in the countryside with a shitty connection (pleasant working environment though). So, an hour (or two, on a bad day) to do the tar-ftp-untar thing compared to a few minutes with rsync. Because the connection was so shitty it wasn't just that the ftp part left the developer twiddling his/her thumbs for an hour, it made life difficult for everyone in the office for an hour. Those companies switched to rsync as soon as I demonstrated it to them.
      And it's also good for server migrations. Prior to me coming along and teaching them about rsync, a server migration required a code freeze whilst tarballs were packed, tarballs transferred from one server to another (usually data centre to data centre, so speed was good), tarballs unpacked, new server tested. Not forgetting the mysqldump on the old server and restore on the new. That usually meant a code freeze of 3 or 4 days on all the sites on the server. With rsync it was an hour of code freeze. Yeah, transfer the lot beforehand without a freeze, because that's a lot of data and takes a while. But then freeze and rsync to catch up on changes in an hour.
      The day I found rsync was the day I stopped using tar for backups. That was 16 years ago.

  • @srinivasachakradhar2442

    The way you presented Linux videos were really fantastic and it was very crystal clear.Can you share me the link if you have complete Linux Courses Videos....