LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-10-2011, 11:37 PM   #1
stealth13
LQ Newbie
 
Registered: Feb 2011
Posts: 17

Rep: Reputation: 0
Scheduled backup question


How do i create a tar backup (using gzip compression) called /backup/boot_files.cron that will backup the /boot directory monday at 4pm ?
 
Old 02-11-2011, 12:55 AM   #2
KamasCZ
LQ Newbie
 
Registered: Jan 2011
Location: Czech Republic, Tyniste n. O.
Distribution: Slackware
Posts: 21

Rep: Reputation: 1
Hi,
you must add a line in /var/spool/cron/crontabs/root like this:
0 4 * 1 * /bin/tar czf /backup/boot_files.cron /boot

then run crontab -e and quit it by :wq
 
Old 02-11-2011, 01:07 AM   #3
tuxianD
Member
 
Registered: Jul 2006
Location: MumbaI
Distribution: Fedora 14, Solaris 10
Posts: 55

Rep: Reputation: 15
Lightbulb

Quote:
Originally Posted by KamasCZ View Post
Hi,
you must add a line in /var/spool/cron/crontabs/root like this:
0 4 * 1 * /bin/tar czf /backup/boot_files.cron /boot

then run crontab -e and quit it by :wq
I think it has to be -

0 16 * * 1 /bin/tar czf /backup/boot_files.cron /boot

Correct me if I am wrong.
 
Old 02-11-2011, 01:23 AM   #4
vinodvb
LQ Newbie
 
Registered: Dec 2010
Location: Bangalore
Distribution: RHEL
Posts: 25

Rep: Reputation: 6
Its always recommended to edit the cron file using the command
Code:
crontab -e
and not directly edit the file in the spool directory.
NOTE: Chances are there may not be any file inside the cron directory if there are no cron jobs defined before.

The crontab entry by tuxianD is correct.

So, the steps would be:
1- crontab -e
2- Add the cron job (0 16 * * 1 /bin/tar czf /backup/boot_files.cron /boot)
3- Save and exit (:wq)

Last edited by vinodvb; 02-11-2011 at 01:27 AM.
 
Old 02-12-2011, 02:17 AM   #5
KamasCZ
LQ Newbie
 
Registered: Jan 2011
Location: Czech Republic, Tyniste n. O.
Distribution: Slackware
Posts: 21

Rep: Reputation: 1
Sure, 16 for 4pm :-)

I use my fovorite editor to edit cron files, then just update it with crontab -e, its the same.
 
Old 02-24-2011, 03:59 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,651

Rep: Reputation: Disabled
Is this home work?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
making scheduled backup image digity Linux - Newbie 5 03-28-2009 09:49 PM
scheduled backup - WinXP to Linux samengr Linux - General 4 01-23-2008 07:17 AM
Online backup manager: missing scheduled backups ronaldv Ubuntu 0 11-08-2007 02:14 PM
How to make a scheduled backup using cron file? mus1402 Linux - Newbie 3 02-04-2006 11:23 PM
How to make a scheduled backup procedure using the cron file? mus1402 Linux - Networking 1 02-04-2006 10:51 PM


All times are GMT -5. The time now is 05:54 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration