April 19, 201016 yr I want to use the 2TB cache drive as an external backup drive as well. I have copied some essential files on the unRAID array to a directory in cache drive which I named "Backup". This is just in order to be on the safer side. I used the console and "cp -r" command to copy the files within the unRAID server. However, since I use the mover script which transfers data on the cache drive back to the array, I noticed to my surprise that all files within this directory were copied back to the array last night. Therefore, I would like to ask the following: 1) Is there a way to keep a directory on the cache drive out of the scope of the mover script? 2) Is there another/better way to accomplish this task (ie. use the cache drive as an external backup drive as well)? 3) If #1 and #2 possible, could I use resync to sync certain directories on the array with the backup directory in the cache drive? thanks in advance for your assistance.
April 19, 201016 yr 1) Is there a way to keep a directory on the cache drive out of the scope of the mover script? Yes. Make it "hidden". (name beginning with a dot) mkdir /mnt/cache/.Backup
April 19, 201016 yr Also, I suggest using rsync -a for the initial copy. This way when you go back and do it over again, you only copy over what is newer or changed.
April 19, 201016 yr Author Great hints, thx. Weebotech, I noticed your earlier hint concerning the log file during copying process. Accordingly, I have this command: "rsync -av /mnt/user/DATA1/ /mnt/cache/.backup > /mnt/user/DATA/logs/rsync_data1.log 2>&1" 1. How can I schedule this to run once a week (let's say every sunday morning at 01:00 hrs)? 2. Can I enter multiple entries at once / how one could put them in order like "do first #1 and then #2 and etc.? E.g.: If I wrote a shell script and put the following parameters and named it e.g. "rsync1.sh", will it be ok? ######## #!/bin/bash rsync -av /mnt/user/DATA1/ /mnt/cache/.backup > /mnt/user/DATA/logs/rsync_data1.log 2>&1 rsync -av /mnt/user/DATA2/ /mnt/cache/.backup > /mnt/user/DATA/logs/rsync_data2.log 2>&1 ######## My linux/unix knowledge is "non-existent", hence these "simple" questions
April 19, 201016 yr if you login to your system as root and do a crontab -l you will see root's crontable. one of the entries is. # Run weekly cron jobs at 0:20 on the first day of the week: 20 0 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null So if you copy your script into /etc/cron.weekly every time you reboot it will run at the time mentioned. Do the install via your go script as in the example fromdos < /boot/custom/etc/cron.weekly/rsync_weekly.sh > /etc/cron.weekly/rsync_weekly.sh chmod u+x /etc/cron.weekly/rsync_weekly.sh Initially you can do a mkdir -p /boot/custom/etc/cron.weekly then create your rsync_weekly.sh in that folder. If you need it to run at a more specific time, then install it to a different folder. Create a new cront entry and install it. This requires a bit more, so if you want to go that route let us know.
April 19, 201016 yr Author So if you copy your script into /etc/cron.weekly every time you reboot it will run at the time mentioned. Does this mean if I do not reboot but keep the server on 24/7, it will be run only once at the mentioned time and thereafter wait for the next reboot?
April 19, 201016 yr So if you copy your script into /etc/cron.weekly every time you reboot it will run at the time mentioned. Does this mean if I do not reboot but keep the server on 24/7, it will be run only once at the mentioned time and thereafter wait for the next reboot? No, once copied it stays there and runs every week per the schedule. Keep in mind, it is on a ramdrive, if you reboot, you have to reinstall it back to /etc/cron.weekly.
April 19, 201016 yr Author Keep in mind, it is on a ramdrive, if you reboot, you have to reinstall it back to /etc/cron.weekly. And that happens via the following command which I have added to my "go" script - correct? ##### fromdos < /boot/custom/etc/cron.weekly/rsync_weekly.sh > /etc/cron.weekly/rsync_weekly.sh chmod u+x /etc/cron.weekly/rsync_weekly.sh ##### Thanks again for your time. Regards.
April 19, 201016 yr Keep in mind, it is on a ramdrive, if you reboot, you have to reinstall it back to /etc/cron.weekly. And that happens via the following command which I have added to my "go" script - correct? ##### fromdos < /boot/custom/etc/cron.weekly/rsync_weekly.sh > /etc/cron.weekly/rsync_weekly.sh chmod u+x /etc/cron.weekly/rsync_weekly.sh ##### Thanks again for your time. Regards. Correct.
Archived
This topic is now archived and is closed to further replies.