Syncing Between Two Servers

REDUNDANCY. REDUNDANCY. REDUNDANCY.

We all need redundancy, we all want redundancy but we all don’t have it…except this guy!

So recently I spun up a NextCloud server and just started dumping a bunch of stuff into it. I’ve found quite a bit of cool stuff located in /r/opendirectories and I needed a place to dump it, hence NextCloud!

After just dumping a bunch of random stuff into it I decided to actually use it to store data and wanted some sort of redundancy. Thankfully I have a second location which has two VMWare hosts there so what comes to mind? Spin up a new VM to back the data up to! I went with rclone to sync the data over to the new server.

I have two servers, my NextCloud server which holds all the data and then another server that contains a copy of all the data there. So I installed rclone on my NextCloud server and created an SFTP repository to the other server which is located offsite. Running the initial sync took HOURS, literally, it took about 7 hours to do the first initial sync. Afterwards it’s not so bad.

My rclone is setup as a cronjob to run daily so my data stays in sync, hopefully nothing happens to this NextCloud server like it did my last one! I have my cronjob listed below, I have it export to a file so I can check the log to know exactly what transferred if anything, it only syncs the changes so it isn’t re-syncing all the files (Yes, I did that.)

0 0 * * * rclone sync /media/data/nextcloud USIL:/media/data --ignore-existing -v > /media/data/dailytransfer.log 2>&1