Disk copy commands.

Soldato
Joined
5 Jul 2003
Posts
16,206
Location
Atlanta, USA
Hi.

I currently have a IcyBox 4200 NAS unit.
It basically runs a varient of Linux.

What i'd like to do is put a second drive in it, and have it automatically, at a specific time of the day, copy all the data off the first drive and put it on the second. For backup purposes.

I have been browing around and posting on NAS portal, but with 99% of the portal being German, and those who do help not being much help at all, im hoping that some of the linux guys on here can help?

I can SSH into it via PuTTY/TuTTY and browse around.
Can some explain to me how i'd go about doing this automated disk copy job?
 
You could setup a cron job to copy "cp" the directory to the other disk. If the IcyBox supports RSYNC it would be best to use that as it will only copy changes.
 
You could setup a cron job to copy "cp" the directory to the other disk. If the IcyBox supports RSYNC it would be best to use that as it will only copy changes.

There are rsync packages for it, but none of them work. :(.

How would i go about setting up a cronjob?
 
What do you mean? Sections 2 and 3 make it very clear.
$ export EDITOR-vi
$ crontab -e
Add in a job you want e.g. 30 23 * * * <command to be executed> This will run the command everyday at half 11.
$ :wq! (assuming you are using vi)
 
Usually to create a cron job you would run 'crontab -e' as root.

If you want a job to run once a day you would add something like this:

Code:
# min hour dom mon dow
0 0 * * * /bin/cp -Rp /from /to > /var/log/backup.log 2>&1

Where:

min = minute of the hour
hour = hour of the day
dom = day of the month [1-31]
mon = month of the year [1-12]
dow = day of the week [0-6, 0=Sunday]

So in my example above at midnight every day run '/bin/cp -Rp /from /to' and log all output to /var/log/backup.log.

This assumes you have the destination partition you want to backup to mounted as '/to'. If it isn't you could also do this with 'scp' (secure copy) to remotely connect.
 
Thanks for the link.
But thats of no use to me.
I cant stand articles that dont even show working examples. The example is does give is a little sus.
Plus, i think it has to be in a certain format/syntax to work with this NAS..?
*shrug*
It gives you four examples there and tells you exactly what the syntax should be. I'm no linux guru, but I would have thought crontab uses the same syntax everywhere.
 
Doesnt matter now.
I decided not to get a second drive for the NAS for the time being.

The examples are for Crontab when youve got the point of running it. Manually.
Not the 'pre' bits, like where to put the file. Where to tell the system to run it from. Getting the system to run it. ect;
 
Back
Top Bottom