We have 2 NAS Synology Disk Station 1618+ with DS1618+ OS' version. The first one (NAS1) receives backups from multiple servers and the second one (NAS2) is supposed to be the backup of that NAS. So, as this second NAS is supposed to be our last resource in case of disaster, we want it to keep it isolated. And, in addittion, we want it to stay switched off.
The idea is simple:
- 2 days a week NAS2 is waked up using WoL, for example at 12:00.
- At 12:10 NAS1 starts backup to NAS2.
- As the backupd ends, NAS2 shutdowns.
Question is, how to automacilly shutdown NAS2 as the backup ends?
We've tried it at 2 ways with bad results.
1. Rsync cli
It seems that there's a way to execute remote commands after a sync using rsync in command line, so it should be as easy to create the script at NAS1 and add it to the crontab. Problem is that we have multiple problems with permissions and, even executing rsync as root and connecting as root to remote server, even in that situation we get permission errors.
2. Script at NAS2
Make a script in NAS2 at this way
while (backup is up) { pause }
shutdown
Question is, how can we figure out if backup is in process? We've tried at 2 ways:
netstat -ta | grep $NAS1
That command should do the work but it doesn't. When the backup ends some connections stay between NAS1 and NAS2 so the netstat command returns that connections.
And other approach is:
find /.../backups -mmin -240
But this doesn't do the work to.
Any idea?
0 Answers