Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cache drive as an external backup?

Featured Replies

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.

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

 

  • Author

Purko, thank you. What a helpful and friendly forum :)

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.

 

  • 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  ???

 

 

 

 

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.

  • 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?

 

 

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.

  • 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.

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.