Version 5 Development > Roadmap

Mirror user share?

<< < (2/3) > >>

mcs:
rsync can be used to create the dated snapshots or replicate areas using the technique discussed in
http://blog.interlinked.org/tutorials/rsync_time_machine.html

I run a similar script to "backup" files on unRAID diskA to a dated snapshot of the files on unRAID diskB

Helmonder:
I have now implemented the following on my unraid system:

SITUATION:
I allready had a "Users" share that holds all my personal documents, as stated by the previous poster these are files you do not want to use but they actually use very little diskspace, that makes it not a problem at all to store duplicate copies on a different disk that are synchronised in a specific schedule. This enhances file security on unraid twofold:

Why ?
1) Disk failure will have an extra layer of security for these important files (ofcourse mainly thru parity but should two drives fail then there still is a copy on the other disk)

2) SUF (Stupid User Failure) You will always have a copy of your most important files readily accessible should you delete something by accident.

How ?
1) Create an extra share on your unraid system, make sure data is on a different disk then where the data is on that you want to extra-protect (I have my important data in "USERS" and I have created an extra share called "USERS_YESTERDAY");

2) Mark the share "Not exported" (that will make sure you do not work on the copy share by accident)

3) Edit your GO script and add the following line at the bottom (ofcourse change share names according to your specific setup):

echo "rsync -avz /mnt/user/Users /mnt/user/Users_Yesterday" | at 23:00

This will make sure the two shares will be mirrored every evening at 23:00.


Stuff to consider:

- The "yesterday" share will grow only since files are not deleted if they are removed from the basic share, I did this on purpose, I rarely delete files from this directory and not having deleted files removed from the Yesterday share will be good for me, an accidental deleted file will still be there even months after I accidentily deleted it. If you do not want this then adding --delete-- to the command in the go script will also remove files in the Yesterday share that are no longer present in the basic share (I do not recomment however, a catastrophic user failure deleting all files in the basic dir will result in an empty Yesterday share after 23:00).

- In case of a two drive failure with your extra protected data on a failing drive you will still have these files on the Yesterday share, unless ofcourse your Yesterday share is located on the second drive that fails... You can go as far as You want with this and even add a second yesterday share..


Possible improvements:

With a little more tinkering you could also have a "USERS_LASTWEEK" and "USERS_LASTMONTH" share. For me that will be a bit over the top but it is as easy as the above with the exception of the need to use CRON instead of the "AT" command.

Something I have no idea of doing but I do think would be nice is adding this to the interface as a plugin.. You could have a standard "Yesterday" share created for every share that got an extra checkmark (kind of windows home server like).

Joe L.:
The script you posted will run ONCE, at 23:00 each time you reboot the server.  It will not run daily, it does not run a second time on the next day at 23:00. (unless you reboot the server daily, and the "at' script is scheduled when the "go" script line is invoked again )

You'll need to create a cron entry for that same task, and not use "at"  It is not that hard, so you are close to your solution.

Joe L.

Joe L.:
Something like this will work  (entered all on a single line in the "go" script, or on the command line)
(crontab -l | grep -v Users_Yesterday; echo "23 00 * * * rsync -avz /mnt/user/Users /mnt/user/Users_Yesterday >/dev/null 2>&1") | crontab -


The initial "crontab -l | grep -v Users_Yesterday"
will output the existing crontab entries without the line containing "Users_Yesterday".  The echo then appends the desired command and it is all submitted back to a second "crontab -" that installs the new command.

Once run, you'll see your rsync command if you type
crontab -l

It will then run every night at 23:00.

Joe L.

Helmonder:
Seriously.. This is exactly why I like products like this, I am improving and learning in the process, thanks !!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version