1. Hi,


    I've been building a FileServer with RAID1 (Ubuntu Software RAID). No problems there! But, I want to better this server, so that it makes backups as well. Therefore I've bought 4 new WD drives, 2 x 2Tb and 2 x 1Tb.

    I want to use the 2 x 2Tb drives for RAID1 with the OS, swap etc. and then use a CRON command to "copy" the content of the fileserver to 2 separate drives. (1 copy on each 1Tb harddrive).

    What I need is:
    1. The command to copy all the content of the RAID1 (except the system files) to both "extra" harddrives. I'm guessing the CRON daily is the place where this file needs to be located.
    It must be something like:
    Code:
    #!/bin/sh
    
    cp -r md1/data/* sdc  
    cp -r md1/data/* sdd 
    
    done
    
    2. Maybe cp -a is a better argument?

    3. Will the first command line be executed before the next? Or will it just execute both right away? I'm guessing the last one. How can I make it, so that the first copy will be done, before the next starts?? Is it possible??

    4. Which filesystem will be the best for these 2 extra backup harddrives? It's a mixed environment! Files from NTFS systems and from Ubuntu Desktop & Ubuntu Server as well!! Ext4 ??? FAT32 so that the disk is easily used in other systems?

    It's my first CRON command/setup, so if you've got some knowhow you want to share with me, please don't hesitate to tell me ;)
    Sorry for this newbie question :eek:

    Have a nice weekend ;)
     
    Last edited: Sep 7, 2014
  2. srijan

    srijan New Member HowtoForge Supporter

    I don't believe cp to be very reliable command for backup. Iwould recommend rsync for such type of job.

    Use like this

    It wil be the command

    For cron use

    where
    contents are
    /home/dan/backup must be executible
     
  3. srijan

    srijan New Member HowtoForge Supporter

    Again if you want the script to get run at specific time such as 10:00PM use

     
  4. Hi Srijan,


    Didn't see this until now ;)
    Thanks a lot!! Now I can get going ;)


    Taking your great answer from the other thread to have it all in one. Maybe others can use some of your ideas ;)

     
    Last edited: Sep 10, 2014
  5. sda or sd0 ????

    Hi,


    When is it "sd0" and not "sda"??? When cheking one of the other servers the system is using "sda". But I'm pretty sure "sd0" was used when I made the first FileServer with RAID1. It has nothing to do with the RAID I know taht, becuase this is called "md*" by the system. Just if you know it. I'm doing labels for the new drives ;)

    Found this and now I'm totally lost ;)
    http://www.tldp.org/HOWTO/Partition-Mass-Storage-Definitions-Naming-HOWTO/x99.html
    Maybe there's separate rules for Ubuntu

    9:31pm:
    Sorry Srijan, maybe I've mixed things up. Maybe it had something to do with the partitions sda* . sda1, sda2 etc. Never mind that now! Moved on and will make the labels afterwards ;)
     
    Last edited: Sep 10, 2014
  6. srijan

    srijan New Member HowtoForge Supporter

    You can check your drives correct label with
    and in the
    or
    file.
     
  7. Hi Srijan... CRON ????



    Hi Srijan ;)

    Hope you are well and doing great ;)

    So it's a little shell script cron will run? Can you help me setup cron I never did it. I've been looking at the different dron files daily etc. etc. but I'm pretty nerveaus about cron.

    I can't remember about this:
    Again if you want the script to get run at specific time such as 10:00PM use
    0 22 * * * /home/dan/backup


    Can you help me with this my friend ;)



    .
     
    Last edited: Dec 5, 2014

Share This Page