January 16, 20188 yr I guess this has been answered before, but I could not find the answer Im after As far as I know, the best way to to backup an unraid server to another on the same LAN is rsync and setting up a cron job. I know not much about rsync, and I know even less about cron Does it exsict any plugins for unraid that kinda gives an gui on how to setup this, or is it more easy than I think it is from the terminal?
January 16, 20188 yr Community Expert If the target server doesn't have password for root it's easy to setup a scheduled rsync using for example the user scripts plugin, if it has you need to look on how to create a ssh key for passwordless rsync.
January 26, 20188 yr On 1/16/2018 at 8:53 AM, isvein said: As far as I know, the best way to to backup an unraid server to another on the same LAN is rsync and setting up a cron job. I know not much about rsync, and I know even less about cron I recently went through this process and now have my server-to-server backup automated through rsync and a script managed by the User Scripts plugin set to run a weekly cron job. Below is the guide I used. I modified tr0910's script for my purposes and used the ssh setup suggested by ken-ji. For now, both servers are on the same LAN but this will work over a WAN as well when I move the backup server offsite:
January 26, 20188 yr Author Thanks I checked out the rsync syntax and it was more easy than I thougt so now it seems to work, I skipped the ssh part as I have the servers on the same lan and the backup folders on the target is mapped to the source with NFS. But the scheduler of cron is confusing, if I choose weekly, weekly from when?
January 26, 20188 yr 29 minutes ago, isvein said: But the scheduler of cron is confusing, if I choose weekly, weekly from when? My backup server is not always running, so mounting NFS shares is not the best option for me. In fact, it only powers on via IPMI when the script runs. After the backup, the script turns it off via IPMI. My cron job through User Scripts plugin (I run the backup automatically with a script) is set to 0 1 * * 1 which is 1:00am every Monday. You can find a good explanation and crontab generator at http://corntab.com/ The five positions in crontab are minutes, hours, day of month, month, day of week. So my crontab is 0 minutes, after hour 1 (24-hour clock), * day of month not specified, * month not specified, on Monday (day 1). Edited January 26, 20188 yr by Hoopster
January 26, 20188 yr Author That make sense Mine is on all the time. I aslo guess it should be possible to make 2 versions of the same backup script, say the first one running each week and the other one each 90days and that one has the --delete flag on. Would that make it so it takes backup each week and every 90 days it takes backup and delete off the files that has been deleted from the srource?
January 26, 20188 yr 10 minutes ago, isvein said: That make sense Mine is on all the time. I aslo guess it should be possible to make 2 versions of the same backup script, say the first one running each week and the other one each 90days and that one has the --delete flag on. Would that make it so it takes backup each week and every 90 days it takes backup and delete off the files that has been deleted from the srource? Yes, that should work. For now, I am not deleting anything on the backup server as I know that I can find a deleted file there if needed. Eventually, I will be doing what you are doing as the backup server fills up. I also keep it off until the backup runs in case my main server gets hit with ransomware or some virus the corrupts files. Not having the backup on prevents anything on the network from affecting its contents. Hopefully, I would catch file corruption or other issues before 1am on Monday or the corruption would be propagated to the backup as well.
January 27, 20188 yr Author Hmmm, looks like the script wont run by itself, getting this message in systemlog: Jan 27 12:19:11 oneroom crond[1620]: failed parsing crontab for user root: SAT /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/BackupMedia/script > /dev/null 2>&1
January 27, 20188 yr 8 hours ago, isvein said: Hmmm, looks like the script wont run by itself, getting this message in systemlog: Jan 27 12:19:11 oneroom crond[1620]: failed parsing crontab for user root: SAT /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/BackupMedia/script > /dev/null 2>&1 How are you running the cron job and how is it formatted? There should be a space between each element. If not, it will not parse correctly, My crontab for running backup every Monday at 1:00am is 0{space}1{space}*{space}*{space}1. If entered as 01**1 it wont work. This is a common mistake. Not saying that is your issue, but, it is worth checking.
January 27, 20188 yr Author It is setup from Settings-->UserScripts and it is a space between them all. Gona try to ask about this in the thread for the customScript plugin. Edited January 27, 20188 yr by isvein
January 27, 20188 yr It is setup from Settings-->UserScripts and it is a space between them all. Gona try to ask about this in the thread for the customScript plugin.What is the SAT that's in there?
January 27, 20188 yr Author 22 minutes ago, Squid said: 59 minutes ago, isvein said: It is setup from Settings-->UserScripts and it is a space between them all. Gona try to ask about this in the thread for the customScript plugin. What is the SAT that's in there? aaaa that was the problem Thanks, changed it from SAT(saturday) to 6 and now it seems to work just fine
Archived
This topic is now archived and is closed to further replies.