Linux Crontab task scheduler used to backup mysql data autmatically

Linux Crontab task scheduler used to backup mysql data autmatically


Download this video http://thehackhub.com/videos/Linux%20...

This tutorial shows how to usecrontab in linux to schedule tasks to run automatically. In my case i use crontab to backup my mysql database automatically daily and store the file in a backup directory.
Closed Caption:

whats up guys today I'm going to do a
little Linux tutorial here on crontab
just a basic little rundown of crontab
now arm if you have a mysql database arm
if you're running like I say a lamp
server and you want to automatically
backup your mysql database actually
crontab can be used for anything it's
usually it's like at a schedule and you
can use it to do just about anything on
your computer but it's really good for
actually backing up your mysql data
whether you can do that you can do that
like weekly monthly daily hourly however
you want to do it it just depends on
what you want i personally back of my
mind
SQL database daily so that let's just
say if your if your server to crash or
for some reason some buddy were to hack
into your system or you know whatever
the hell the case maybe if you lose data
you have backups of it and you can
restore your latest backup of course you
will always lose some data because
you're going to have the data between
the time that you lost your data and the
last backup but you won't lose all of it
so what you use for this and linux is
the crontab so if we just did an LS and
then / ET c and if we go up you'll
notice that there's on there's a bunch
of these little cron things right here
there's chron . d . daily too early .
monthly then there's a crontab now these
are just folders user directories and
then the . weekly then is the crontab
itself so what we're going to do is
we're going to use our text editor to to
edit this to change some of the values
in there and to add new tasks just use
whatever texture you prefer i use the
pseudo VI the visual editor for the vm
anyway and then what we do is I just go
/ ptc arm / cron
sorry / 0 and three in the were in the
wrong folder it / ET c / cron tab area
so you do that and what happens is
important breaks open this little page
here and basically all explain what all
this means all this gibberish ever but
this is what will come in the thing when
you have it this is what will come party
loaded with the crontab and then this is
the line that i added so ignoring this
for now basically what these are these
are just including all those directories
that we saw earlier the chron . day that
weekly not monthly to do normal machine
you know routine processes linux already
has processes pretty packages
prepackaged with it that it runs daily
weekly and monthly so that's what these
are for I would not ever dont i would
recommend you delete these because it
may make your stay in your system
unstable and linux does need these to
operate properly
however you can just go ahead and throw
on a new line down here of your own
statement you could also add in one of
these directories but what that would do
is let's just say through this line here
this command in one of these in the .
daily folder this this command would be
processed every every with along with
everything every other daily process at
this time
this is the time that your your process
is scheduled to go for us let me explain
how this works on it says up here you
have it right here
the minutes is what this is the hour day
of the month the month the day of the
week the user that is going to execute
the command and the command itself it's
that simple
now you do have to be familiar with
linux commands in order to do this I'm
so that you can type the command in here
but let's just go ahead and say for me I
back my database up at the fifth hour
of and and 30th minute of every day so I
530am every single day I back up my
database now this is a 24-hour clock
there's no am or PM it's not like you
put 1230 Emery like that if you want to
do it at you know
twelve o'clock a.m. you're going to put
your 0 or if you want to like eleven
o'clock p.m. you're gonna put 23 hours
its military time so you're not going to
put something like 11pm or anything like
that it's not gonna work then you have
the 30 minutes so this is the minute of
the hour
this is the hour and then right here is
the day of the month so i can say do it
the fifth day of every month so on the
fifth very month if I put a five right
there we'll do it the fifth very much
now i put a star right there which means
do it every single day i can put the 50
very month and then i can say also the
specific month so i can say six for our
june and so if i put a 6 here and a 5
here every June every fifth day of june
it would run this command so it would
only do it once a year because the fifth
day of june only comes once a year right
so on and then so this would be anywhere
valid up to like 31 days or whatever it
is in a month
this would be anywhere from one to
twelve for the data the month of the
year and then this is the day of the
week now you're either going to have the
day of the month or the day of the week
that you're never going to have really
both of these set on if you say arm a
specific month and then this day a week
this day of the week it means it's going
to go only on that David week so if we
have let's just say they had this works
from 0 to 60 is Sunday and six is
saturday so Monday's won tuesday's too
so it'll be anywhere about valid from 0
to 6 and that would make it run only on
a certain day of the week i have a star
a star a star for the wild card which
means do it every day of the week every
month of the year and every day of the
month at five-thirty
now the the user that's writing this I
have it as root this gives it that extra
privilege and then what my command is
this is my command
so we just put a space and start taking
out the command so i'm using the my SQL
dump command which dumps it and it dumps
all the data in my database and then i'm
using the minus u which is the username
of the mysql com user and just so you
guys know this is not actual information
from my skill database i did change the
username and the password for my school
database
this is just an example here but so you
would have cashew space and in the
username for the mysql database user and
then dash p no space and then the actual
password of that mysql database user you
do you have to type out the password it
will show it in plain text unfortunately
if you don't put the password and
username in there it's not going to give
you the privileges to access that mysql
database right my database name is
technique forms is the name of my
database that's going to take all the
tables and everything inside this
database and just dump it and it's going
to put it into a file and it's going to
export that as a . SQL file and what
this is doing is this is saying to dump
it and this little carrot type of
looking thing they're the greater than
sign or whatever and then you have this
is just the directory it's actually a
parent directory so its dot slash dot
slash and then my SQL backup / backup
and this is this so this is the name of
the directory is under the directory
mysql back up and then this is the name
is through stores the file as so it says
the name of the file that i have it
story is backup underscore date and then
the name of in it shows the actual date
so it depends the actual time this is to
put the time it shows the month day and
year ended and names it . SQL that's for
the file extension so it's naming it
back up underscore date and then it
displays the act
you'll date that it was backed up on
that his name is the file naming scheme
that we have there and of course . SQL
for the file arm that is just an example
of how you can backup your mysql
database and like I said guys you can
use kron4 anything I can literally I
mean let's just go ahead and make a
quick let's go ahead and go insert and
we'll make a new quick little crontab
command grow real quick here just to
show you guys how simple is so if I said
0 this means it's going to do it at 66
a.m. every day if i go star star star
groups you have to put a space between
guys star star star they will change
different colors
I'm gonna run this command another root
user and then all i'm going to do is you
could do any command you want like I
said it doesn't have to be specific
commands i can say I'm copy the you know
I could say copy the bar / www directory
to anywhere I could say copy
oh you'd have to use if you're going to
copy a directory of course you have to
reclusive make a reclusive but then you
could copy it to slash backup
let's just say and what this command
will do is it will literally at 66 a.m.
everyday copy this folder this whole
directory into this folder so you can
run any command you want as long as it's
a valid linux command on you can run it
and i'd recommend you test it first so
you change your time here to a minute
that's just about to happen like two
minutes from when you actually make the
file and then just on save the command
and check to make sure it is actually
running properly and if it is then put
it back to the time you actually want it
to run the command that way you know
that you take the command properly that
it works so then we're just going to go
ahead and hit escape colon and then W to
write and Q to quit i'm just going to
hit Q to quit because i don't want to
save any changes on because the file i
have already works perfect
so let's go ahead and escape q ! saying
night i'm sure i don't want it to save
and then if we go on I'll show you guys
that folder if i go to slash my SQL
backup and I listed let's go ahead and
LS and these are all the files so that
we can see that it's back up right here
just like the naming scheme that we made
and it says 09 02 2013 so these are the
this is the month
this is the day and this is the year so
it literally backs up everyday and names
the file based on the day that it saved
the file and then on it and makes a .
SQL file so my my skill database ever
did get if it ever had a problem i could
restore one of these backups that it
backs up daily and on it would be okay
and if you really wanted to get crazy
let's just say uh very secure you could
also write another crontab scheduled to
take these specific files on the server
and move them to say another server so
you could use the copy command and back
these files up daily to another server
or two you know an off-site storage that
way if the server to some for some
reason you know get damaged or whatever
and that all the data on that server was
damaged you would have it backed up
off-site or somewhere else besides that
server from that's pretty much it for
how you can backup your mysql database
automatically every day i hope you guys
enjoyed this quick little tutorial of
crontab and if you guys want some more
tutorials go ahead and head over to my
website the hack . com make some
requests i enjoy doing these i hope you
guys found this useful and like always
going to have a good one

Video Length: 13:01
Uploaded By: Jacob Dykstra
View Count: 9,230

Related Software Products
MySQL Auto Backup
MySQL Auto Backup

Published By:
SwordSky Software

Description:
Auto Backup for MySQL Professional Edition is a powerful Windows program that makes it easy to schedule the backing up and restoring of your remote and local MySQL databases. It's easy to back up one or many MySQL databases, and restore them to the same server, or to any server. You can to customize the scheduler so that the program would automatically make the backup from the MySQL databases daily, weekly, monthly, any special date or time interval.BRBackup MySQL databases to SQL or PHP ...


Related Videos
How To Backup and Restore Your Website Files - MYSQL Database With Cpanel
How To Backup and Restore Your Website Files - MYSQL Database With Cpanel

Learn to easily backup and restore your website files and MYSQL database using your web hosting CPANEL. http://howtowebmaster.com, webmaster tutorials on SEO, web marketing, domain names, software. make money online, and more. New How To Webmaster Videos Added Regularly! hr / bClosed Caption:/b font color="#E5E5E5"this video/fontfont color="#CCCCCC" I'm going/fontfont color="#E5E5E5" to show you how you/font canfont ...
Video Length: 04:44
Uploaded By: Leon Tran
View Count: 129,976

How to backup MySQL database using PHPMyAdmin
How to backup MySQL database using PHPMyAdmin

How to backup your MySQL database using PHPMyAdmin. This will apply to anyone with a custom blog or website that uses MySQL including Wordpress blogs, Expression Engine and more. Note- if you are looking for reliable and fast hosting, please see my blog post here: http://tristantom.com/new-web-host/ Also see my blog here: http://tristantom.com/video-tutorial-... If you read this description, be sure to let me know in a comment! Did you remember to like and ...
Video Length: 04:55
Uploaded By: phototristan
View Count: 67,020

MySQL Advanced - Backup & Restoring Databases
MySQL Advanced - Backup & Restoring Databases

http://www.killersites.com In this important video tutorial from our Advanced MySQL course, we show you how to do backups and restore your data with the help of the MySQL Dump function! We've only made part of our content available for free. For the rest, check out our Killer Video Store or our Video Tutorial Library at Killersites.com! http://www.killervideostore.com/ http://www.killersites.com/university/ http://www.killersites.com/community/br ...
Video Length: 10:11
Uploaded By: Stefan Mischook
View Count: 22,170

How To Backup and Restore MySQL databases using Workbench
How To Backup and Restore MySQL databases using Workbench

How To Backup and restore MySQL databases using MySQL Workbench
Video Length: 09:09
Uploaded By: Saju M
View Count: 14,925

How To Manually Backup WordPress MySQL Database, Files and Folders | WP Learning Lab
How To Manually Backup WordPress MySQL Database, Files and Folders | WP Learning Lab

Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist: http://vid.io/xqRL How To Manually Backup WordPress MySQL Database, Files and Folders | WP Learning Lab In this WordPress tutorial I'm going to show you how to manually backup WordPress MySQL database, files and folders. Being able to backup your website is important because you will want to do this before you install any updates to WordPress themes, plugins and core files. Also, if you have a WordPress ...
Video Length: 04:49
Uploaded By: WP Learning Lab
View Count: 14,070

MySQL - Backup Database - Linux
MySQL - Backup Database - Linux

http://filmsbykris.com/wordpress/?p=320 Got Questions? visit http://FilmsByKris.com/forum Chat with us and learn more http://FilmsByKris.com/irc hr / bClosed Caption:/b okay we've created a database for the table and some entries and fill in the fields so now you want to occasionally backup your data base just in case something ever happens to your server and this is very simple to do with a tool called my SQL dump my ...
Video Length: 02:35
Uploaded By: Kris Occhipinti
View Count: 12,983

Easy CPanel Backup Automation using Cron job and PHP script
Easy CPanel Backup Automation using Cron job and PHP script

http://www.hostliketoast.com This video outlines the steps to setup a scheduled backup of your cpanel web hosting account using a script we provide for download (http://www.hostliketoast.com/2011/09/how-to-schedule-full-automatic-cpanel-backups-mysql-databases-files-cron/) hr / bClosed Caption:/b hey guys and welcome this tutorial and mister I'm gonna show you how you can shut up scheduled back of yours see powell et was think Eugene thing ...
Video Length: 04:00
Uploaded By: hostliketoast
View Count: 11,973

MySQL - Restoring Database From Backup file - BASH
MySQL - Restoring Database From Backup file - BASH

http://filmsbykris.com/wordpress/?p=320 hr / bClosed Caption:/b of up okay so we messing with our database table here quite a bit and basically we got it down to where weekly all users except for one and she's in there I five times are likely not too long ago I did a backup my database so let's see how we can restore that so we'll just type in X your text the MySQL and my list files in my ...
Video Length: 03:55
Uploaded By: Kris Occhipinti
View Count: 11,133

6 MySQL Video Tutorial Importing Backup
6 MySQL Video Tutorial Importing Backup

In this video tutorial you will learn how to import database in mysql. We will go through 2 different methods. 1. using "source" command from "mysql" command prompt. 2. using "mysql" command promt tool. hr / bClosed Caption:/b welcome to the sixth video tutorial for my sequel in this tutorial we will learn about how to import databases from backup we will use an example of one database from my sequence website it is a ...
Video Length: 06:33
Uploaded By: itvolunteersuk
View Count: 10,882

MySQL Tutorials: How to take dump/backup of a database
MySQL Tutorials: How to take dump/backup of a database

In your work life, many a times you need to take a backup of your database. In MySQL we use mysqldump for this purpose. In this video we will have a look at how to use this. Also sometimes you get error mysqldump: Couldn't execute 'SELECT @@GTID_MODE': Unknown system variable 'GTID_MODE' (1193) while executing this command. We will also see how to tackle this issue.
Video Length: 04:50
Uploaded By: GangesLearning
View Count: 10,851

Copyright © 2025, Ivertech. All rights reserved.