[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

back up on linux fedora

I have 2 hardisks on linux fedora how can i back up  /home directory to another hardisk every day
0
teera
Asked:
teera
  • 5
  • 2
  • 2
  • +1
4 Solutions
 
ahoffmannCommented:
man cron
man rsync
(rsync can be found at http://rsync.samba.org/ )
0
 
PhreonxCommented:
Hello,
write a small script that copies only the diffs and create a crontab as ahoffmann suggested. The script will be executed as often as you define in the crontab. It will take considerably more time to complete the first time because it will copy the entire /home tree but after that completion times will reduce. Here's the script:

#!/bin/bash
# ScriptName: DailyBackup
cp -uR /TargetHome /DestinationHome

-u: Copies files only when the source file is newer than the destination or when the destination file is missing.
-R: Process (sub)directories recursively

Make DailyBackup executable:

chmod 700 DailyBackup

To edit your crontab files type:
crontab -e

0 14 * * * /path/to/DailyBackup

Your script will get executed everyday at 1400h. Modify the time as suited

Hope that helped ;)
0
 
ahoffmannCommented:
cp is a very, very bad suggestion for backup 'cause it does not preserve links, and permissions
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PhreonxCommented:
You're right. Should have specified:

cp -uRp /TargetHome /DestinationHome

Does that look better?
0
 
ahoffmannCommented:
no
0
 
xDamoxCommented:
Hi,

I would recommend rsync as ahoffmann said also you can use part image

http://www.partimage.org/Main_Page

Part image has a texted based GUI and is excellent for backups it uses the dd method but does not copy empty nodes.
0
 
ahoffmannCommented:
> .. texted based GUI
LOL, what do I need a GUI for if it is text based?
*SCNR*
0
 
pjedmondCommented:
As ahoffmann said - rsync is the way to go.

Edit the crontab to add something akin to:

0 14 * * * /usr/bin/rsync -Cavz /home /bu/folder

(   (()
(`-' _\
 ''  ''
0
 
pjedmondCommented:
>LOL, what do I need a GUI for if it is text based?

..so that he can have lots of tabs;)
0
 
ahoffmannCommented:
is one tab on the keyboard not sufficient? I'd be confused by multiple tabs :-))
xDamox, I guess you know how to read smileys ...
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now