Solved

Fedora 5 Backup to usb hard drive

Posted on 2006-10-30
8
161 Views
Last Modified: 2013-12-16
Hello EE.  I have a linux box, providing file services, firewall and proxy.  setup with help from many of you (thanks)
What I want to do is backup the /data partition (samba)  to a usb drive which is permanently attached and then shut down the machine daily at 7pm.  So basically I have a folder on the driver  which is at /media/sea_disk/Backups

I would like the daily backup to only backup what has changed.  And then on saturday do a complete backup to the same location.

And then shut down the machine.  


0
Comment
Question by:aduhwale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 14

Accepted Solution

by:
ygoutham earned 250 total points
ID: 17840408
for the daily backup, you can try rsync

rsync -avz --delete /data/* /media/sea_disk/Backups/

please note that the --delete is only an option if you want the target files to be deleted as well. remove it if you want to retrieve any deleted files that a user might request for (which happens at all time with me :-)

for a weekly backup, just to a

cp -Rp /data/* /media/sea_disk/Backups/  

the weekly backup and daily backup can be run through the crontab.

do a

crontab -e (as root)

01 0 * * * (your rsync command here)

and for weekly backup

01 0 * * 6 (your cp command here)

the weekly would run on mondays at the change of system clock date.   the hour can be any 24 hour format to run at a specified time.

by shutdown the machine are you stating that the machine should be powered off??? or only the usb drive to unmounted???

you can also put the same in a bash script and run it as a script at an appointed hour ending with

'shutdown -h -t 5 "an optional message here"   ' (without the initial and end single quote) at the end of the script to tell the machine to shutdown after finishing the rsync/ cp command.

goutham
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17840411
sorry the weekly command is to run on saturdays (number 6 in crontab entry is right) but monday is wrong

: - (
0
 
LVL 2

Author Comment

by:aduhwale
ID: 18094972
Hi ygoutham , wasnt ignoring you.  Got side tracked with another project.   I am testing this saturday and will then confirm i am successfull.

Regards

Adewale
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 2

Author Comment

by:aduhwale
ID: 18198503
Thanks   ygoutham.    This worked great.  I only need help figuring out where to put the shut down command.  do i put it on the same line as the cp command.
0
 
LVL 2

Author Comment

by:aduhwale
ID: 18198545
in crontab I mean - how do you I get it to point to a script?
Thanks again.
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 18198587
in crontab you have five fields

01 13 * * * sh /path/to/some/script.sh

the above line means to execute a script called script.sh which is a shell script at 13:01 hours every day.  read more on

man 5 crontab
man crontab

to shutdown a machine

shutdown -h -t 5 now

this means to shutdown the machine in 5 seconds from now and halt the system.  the same command can also go into your crontab.  but shutdown is not given enough rights to be run from crontab.  just check on the first before adding the same.  just look at /etc/sudoer
0
 
LVL 2

Author Comment

by:aduhwale
ID: 18201166
Hey.  Thanks!  
I hadnt actually written a script before.  now i have - albeit a simple one.    I am tinkering with the timings but I am good to go.

Thanks again.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question