Тёмный

Linux Backup with TAR and Cron Jobs 

Eli the Computer Guy
Подписаться 1,1 млн
Просмотров 250 тыс.
50% 1

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 /

Наука

Опубликовано:

 

22 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 227   
@juliotalavera07
@juliotalavera07 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.
@anuragchumble8545
@anuragchumble8545 6 лет назад
ELI IS TEACHER WHO CAN TEACH
@hipman87
@hipman87 7 лет назад
I just went through your whole Linux course tonight, massively appreciated, very clearly presented.
@arasonsuresh1042
@arasonsuresh1042 8 лет назад
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.
@REDCAES
@REDCAES 9 лет назад
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!
@MrHav1k
@MrHav1k 10 лет назад
Eli you have by far the best tutorials on RU-vid! I've learned so much from these linux videos and I love how you focus on what matters!
@songsanams6355
@songsanams6355 2 года назад
you are a star after this many years, no one has such a great description
@telao492
@telao492 2 года назад
I wish I would have found you weeks ago! Thank you for explaining this down to the meaning of each character. Much appreciated!
@GaryCameron780
@GaryCameron780 2 года назад
Watching in 2022. Eleven years later this is still very useful. thank you.
@stephenjasonwang
@stephenjasonwang 11 лет назад
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!
@vsworld7757
@vsworld7757 9 лет назад
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 :)
@yanxiang1987
@yanxiang1987 8 лет назад
Thanks Eli for your patient and clear class. I learned a lot from you.
@sandhyasingh7356
@sandhyasingh7356 7 лет назад
you made my life a lot easier with this video.....keep posting these kind of videos...you are too good in teaching eli
@ernestoearlsalunat3785
@ernestoearlsalunat3785 7 лет назад
Awesome job Eli! I had so much fun and boosted my confidence. Cheers!
@Bubblegan
@Bubblegan 7 лет назад
Fantastic tutorial. I am so happy that I found your channel. Keep up the great work.
@GrantTurnerMusic
@GrantTurnerMusic 12 лет назад
Great instruction. Just moved a website to a dedicated server and plan on using this to perform backups. Thanks dude!
@gregjachtoma6490
@gregjachtoma6490 7 лет назад
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
@mazdysoraya6121
@mazdysoraya6121 11 лет назад
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
@prabeshines
@prabeshines 11 лет назад
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
@lvscan
@lvscan 10 лет назад
Excellent Video. Thanks for helping me understand Linux a little better!
@serverguy276
@serverguy276 8 лет назад
Eli, you are great, nice video and presentation. I enjoy watching all of your video.
@calingiurgiu2000
@calingiurgiu2000 10 лет назад
God bless you Eli! Your videos are lifesavers! Thank you ! I wish I could replace my current teacher with you.
@Rchauhan902
@Rchauhan902 8 лет назад
thank you sir for your valuable videos. I learned lots of thing from basic to advance from your tutorials. thanks a lot
@208dharma
@208dharma 8 лет назад
Thank you for your efforts to share your knowledge to everyone who wants. These are very helpful me.
@jimfurman3145
@jimfurman3145 6 лет назад
Awesome I was searching for a linux backup program .... but this is so simple ... thanks!
@ClickJCOnline
@ClickJCOnline 13 лет назад
Eli, Great video. Very instructional and informative to both the expert and the person just beginning. Will look forward to more tutorials. Jeff
@rimmiloud
@rimmiloud 10 лет назад
Excellent Teacher I have seen in my life Since I started the school on 1978
@SwingingInTheHood
@SwingingInTheHood 3 года назад
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.
@liketocode
@liketocode 10 лет назад
Love your videos - educational while entertaing :)
@kewlbeans9905
@kewlbeans9905 10 лет назад
Thank you kind brother. You are a gentleman and a scholar.
@djsensacion7
@djsensacion7 8 лет назад
Thank you for the detailed explanations of it all.
@shikhavyaghra8969
@shikhavyaghra8969 7 лет назад
Thanks for the video....I was struggling with this.This video helped me to solve my problem.
@eventhorizon1306
@eventhorizon1306 6 лет назад
Great series...Thank you Eli.
@prashanthb6521
@prashanthb6521 2 года назад
This was so well explained. Thanks a lot ETCG.
@Axel-rs3cg
@Axel-rs3cg Год назад
appreciate your videos lessons and logical well expressed manner 👍
@jeanettemartinez892
@jeanettemartinez892 4 года назад
Best video yet, you saved my brain thank you!
@elithecomputerguy
@elithecomputerguy 13 лет назад
You can backup / If you need a bare metal backup you can just use a piece of backup software.
@BrianThomas
@BrianThomas 8 лет назад
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?
@ChrisLCBoston
@ChrisLCBoston 10 лет назад
Excellent video again!!
@DavidJKoch
@DavidJKoch 10 лет назад
Excellent tutorial series on Ubuntu Linux !
@KalishAlexander
@KalishAlexander 9 лет назад
thanks a lot, your lessons are very informative and useful.
@aplifiedchaos
@aplifiedchaos 4 года назад
Many thanks buddy. You got yourself a subscriber
@niaei
@niaei 10 лет назад
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 4 года назад
tar -xvpzf your_backup.tar.gz --exclude={"/home/*/Downloads/","/home/*/Documents"}
@mr_gumball
@mr_gumball 7 лет назад
OMG, Thank you. This is the one of the most useful tut
@ciscomind626
@ciscomind626 8 лет назад
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
@morningstars123
@morningstars123 12 лет назад
thanks.. Happy to say u are my Linux teacher ..
@lalitpnwr
@lalitpnwr 11 лет назад
Eli you are a awesome teacher
@iliketobathify
@iliketobathify 7 лет назад
Nano is an excellent editor for those finding Vim too difficult.
@jkupas
@jkupas 11 лет назад
Thanks a lot, you can explain amazingly simple.
@RC-Heli835
@RC-Heli835 6 лет назад
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!
@ldean97
@ldean97 5 лет назад
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
@mikeonthecomputer
@mikeonthecomputer 8 лет назад
-p only matters on the extraction mode (tar -x). It makes no difference on create mode (tar -c).
@shayaanmandal3917
@shayaanmandal3917 4 года назад
Still so much powerful videos
@455rocks
@455rocks 9 лет назад
Sir,can you please do a video on Shell scripting(Bash and Perl)?
@dasanco1
@dasanco1 3 года назад
cron job abort 60 seconds after starting with 'exit code 141' ... thoughts?
@reddysekhar0072000
@reddysekhar0072000 6 лет назад
tq eli, u r making my life easy
@azyske
@azyske 8 лет назад
hi, if I wanna exclude more than one folder? what should I type? "exclude=/video /audio" am I correct? thx
@vdenim86
@vdenim86 12 лет назад
whole day i had struggled and got this video thank u very much , please some video of apache and mysql thanks eli
@Waldi111979
@Waldi111979 11 лет назад
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 6 лет назад
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?
@thetlwintint
@thetlwintint 11 лет назад
thank you very much. You are a really great trainer.
@TRFAD
@TRFAD Год назад
ty this helped but for some reason the commands don't work with cron. I've added date codes so that it puts the date. The syntax works outside of cron but no in the cron tab. Not sure why. Instead I created a bash script and just had it handle it and then cron tabbed the bash script.
@BornWithLegend
@BornWithLegend 7 лет назад
superb sir thanks for upload
@mehretabayalew3890
@mehretabayalew3890 4 года назад
Great tut!
@BrianThomas
@BrianThomas 8 лет назад
another thought I has as well to off site backups. What there were multiple off site storage area's? I have 3.
@EliotPearson
@EliotPearson 11 лет назад
Solid overview Eli.
@dai7169
@dai7169 4 года назад
Thanks a lot Eli
@war11s
@war11s 7 лет назад
Eli thanks for the informational video. quick question, when you did the crontab -e and it opened up crontab and had the # m h dom mon dow cheat-sheet, had you already input that into crobtab file for the sake of the video or did the earlier versions of Linux distributions already have that? I am using centos 7 and it doesnt have that little cheat-sheet. I know that its just a comment because of the # sign but i was just wondering. Thank you :)
@CaseySchneider
@CaseySchneider 7 лет назад
What happens if you are trying to extract from a tar as a tarball by using 'z' in the command?
@satishkumar-to1ud
@satishkumar-to1ud 6 лет назад
Hello Eli Thanks for the sharing knowledge . I have a query , how can we restore the data to same directory where the data is missing instead of creating a recover directory and moving to it . thanks Satish
@explosivo3065
@explosivo3065 4 года назад
This video helped me a lot Thanks !!!
@baldeousmanedade4462
@baldeousmanedade4462 8 лет назад
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
@Amnahbrhm
@Amnahbrhm 6 лет назад
thank you, is it encrypted and if it not how can i encrypt my backup file ?
@sapkotanischal1054
@sapkotanischal1054 5 лет назад
How to backup to the specific folder ? output to specific folder ?
@chrisgast
@chrisgast Год назад
Can I cron a tarball to a storage server? What is the command to add the address and the port?
@PratapKanhed
@PratapKanhed 8 лет назад
Thanks for All lectures
@JamesSamples
@JamesSamples 3 года назад
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
@FranseFrikandel
@FranseFrikandel 11 лет назад
Yes you can, everything you can do with the server can be done with the desktop using the terminal
@HB-ct8hh
@HB-ct8hh 7 лет назад
I don't have a server, just a laptop that I'm wanting a simple way to backup and restore. Can I use this lesson to backup my laptop or is there a better method for my laptop then this lesson dealing with servers? Thanks.
@kousoulides
@kousoulides 11 лет назад
if I type sudo tar -c in my macs terminal will it start backing up everything?? where?
@luisjesuscovarrubiasrodrig2108
Excellent video!, but i have a doubt... What if i want to compress just the File that is inside a nested folders?, for example: /home/user/Music/File.txt I'll be glad if someone can help me with that.
@Grezic
@Grezic 12 лет назад
IT's very easy to understand, thanks very much.
@checkmusic2002
@checkmusic2002 6 лет назад
how we can save every backup by date like 2-3-2017 8:30
@koreamedia
@koreamedia 8 лет назад
Hello, how are you doing? is it gonna overwrite the minutebackup.tar.gz?
@notapplicable2636
@notapplicable2636 6 лет назад
Odd question from a Windows 10 user if you don't mind? (begrudgingly). I want to jump to Linux, and have tried to make a backup using Rsync of my old SSD, and am unsure on whether to use tar.gz instead in order to compress those files...? What do you think? Also is it possible to add a variable date and time to the filename somehow within the Tar command?
@amabowilli
@amabowilli 8 лет назад
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.
@ZXCY00
@ZXCY00 10 лет назад
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?
@ganimikawa
@ganimikawa 9 лет назад
Great video...
@umesh6254
@umesh6254 7 лет назад
Sorry Eli, I know your video is good.. but in the video how did you get wwwbackup.tar.gz? Did you just go through vi and make that empty file or what? Whenever I enter the same command, it says it's not a file or directory or permission denied..
@Ravicgsce
@Ravicgsce 8 лет назад
HI Eli I have a doubt. How do i schedule crontab to create file names dynamically so that my previous backups are not overwritten?
@cyohara4961
@cyohara4961 9 лет назад
Hi. Do you know what Linux OS (if any) that does not prevent you, from having the Home and Backup Library on your external drive. I have spent some time on Ubuntu trying to find out how this could work, without anything positive coming out of it?
@abhisheksingh-ih1eo
@abhisheksingh-ih1eo 3 года назад
You are awesome sir
@raysaul
@raysaul 7 лет назад
Hi Eli I have a question for you, is there a way to backup an entire ubuntu system and restore it with this command or any other terminal like command? I am playing with a vm that is in a hypervisor which I do not have access to and I would like to have that vm backed up to a local machine (through ssh) and how will I go about restoring it? To my understanding, since I do not have access to the hypervisor I cannot use clonezilla or any other tool like that, I do not have access to the boot menu and such. So I am guessing (from what I am encounter) it is impossible to backup the vm, it is recommended to backup only certain files for example just the www folder instead of the whole system.
@01vally5
@01vally5 2 года назад
dear when i take the backup..where is the backup path command?,thanks for your lesson
@viktor133100
@viktor133100 4 года назад
What's the best (easiest) way to tar to a host machine over SSH?
@victorclare442
@victorclare442 7 лет назад
I want to use my backup to reinstall and ovewrite the original
@srinivasachakradhar2442
@srinivasachakradhar2442 7 лет назад
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....
@nachoherranz1240
@nachoherranz1240 10 лет назад
Great teacher
@CaryInVictoria
@CaryInVictoria 7 лет назад
I've been enjoying these tutorials and find them very helpful. Three questions: 1. when extracting from a tar ball, why must you tell tar the file is compressed. Can't it figure that out itself? 2. If I want to schedule a cron job to be performed every Tuesday and Thursday would I enter "24" in the day-of-week location? 3.Suppose I want to schedule a backup once per day with cron, but I don't want the tar ball created today overwritten by the tar ball created tomorrow. I assume there's a way of avoiding that.
@Mirecsooor
@Mirecsooor 8 лет назад
i always recieve error: you have a new email. Have you got idea why ?
@Impulse_Photography
@Impulse_Photography 3 года назад
I typed "sudo crontabs" by mistake. Now, I lost my sudo crontab page - its all blank. How can I recover that page???
Далее
Navigation in Linux
45:28
Просмотров 255 тыс.
Users, Groups and Permissions in Linux
37:00
Просмотров 543 тыс.
Introduction to Domains
47:51
Просмотров 408 тыс.
Backup Strategies for Linux
32:24
Просмотров 12 тыс.
Understanding Switches
58:10
Просмотров 1,4 млн
Vim for Editing Files in Linux
35:29
Просмотров 287 тыс.
Basic Linux Tasks
53:18
Просмотров 890 тыс.
Introduction to RAID
36:01
Просмотров 220 тыс.
Linux Network Configuration
51:19
Просмотров 540 тыс.
SSH and FTP for Remote Administration
26:10
Просмотров 444 тыс.
iPhone 16 - НЕ СТОИТ ПРОПУСКАТЬ
4:50
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00