LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-06-2008, 05:16 PM   #1
SolarisZen
LQ Newbie
 
Registered: Dec 2007
Location: Planet Earth
Distribution: OpenSuSE & Fedora Core 4
Posts: 28

Rep: Reputation: 15
dd iand crontab


Hi again. I hope everyone out there in Linux land had a good new years!

Well I have been progressing in my disaster and recovery stratagy. I have cloned the HD to an external usb HD and all i would like now is to have cron do a backup every so often using dd

so I used this to clone my Linux server

Code:
dd if=/dev/sdb of=/dev/hda conv=notrunc,noerror

How do I implement crontab to to the backup for me automatically using dd?

Last edited by SolarisZen; 01-06-2008 at 05:17 PM.
 
Old 01-07-2008, 10:05 AM   #2
jphilput
Member
 
Registered: Nov 2007
Posts: 58

Rep: Reputation: 15
In some cases I've seen cron die when confronted with a "long" command line, so the first thing that I would suggest is to put your dd command into a basic script like:

Code:
#!/bin/bash
dd if=/dev/sdb of=/dev/hda conv=notrunc,noerror
Then you can add it to root's crontab with the crontab -e command. The new line should look something like this:

Code:
* * * * * /path/to/ddscript
Each of the * characters is a place holder for a time, minute of the hour, hour of the day, day of the month, month, day of the week. The wikipedia entry for crontab has a good description of how to set the execution time.
 
Old 01-08-2008, 07:22 PM   #3
SolarisZen
LQ Newbie
 
Registered: Dec 2007
Location: Planet Earth
Distribution: OpenSuSE & Fedora Core 4
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jphilput View Post
In some cases I've seen cron die when confronted with a "long" command line, so the first thing that I would suggest is to put your dd command into a basic script like:

Code:
#!/bin/bash
dd if=/dev/sdb of=/dev/hda conv=notrunc,noerror
Then you can add it to root's crontab with the crontab -e command. The new line should look something like this:

Code:
* * * * * /path/to/ddscript
Each of the * characters is a place holder for a time, minute of the hour, hour of the day, day of the month, month, day of the week. The wikipedia entry for crontab has a good description of how to set the execution time.

Thank you so much jphilput! Your information was perfect. Love this community!
 
  


Reply

Tags
cron, crontab, dd


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
crontab help RVickers Ubuntu 6 07-23-2007 11:12 AM
using crontab goodolday Linux - Newbie 1 04-26-2005 07:16 PM
crontab -e hoover93 Linux - Newbie 2 08-06-2004 04:05 PM
How to use crontab ? Dakkar Linux - Newbie 2 01-22-2004 10:49 AM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM


All times are GMT -5. The time now is 03:07 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