0

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?

2
  • You could enable ssh then ssh from nas1 to nas2 and run the command sudo shutdown -P now.
    – meuh
    Apr 28, 2021 at 13:44
  • That is the first way we tried, to make a bash script running on NAS1 that executes rsync cli and then a shutdown to NAS2. The problem doing at this way is that even with root privileges we get permission errors during rsync transfers. We configured the NAS2 rsync daemon to be as permissive as possible but it doesn't work at all. There must be a way to configure it properly so we can solve the problem at this way.
    – Joel
    Apr 29, 2021 at 6:34

0

You must log in to answer this question.

Browse other questions tagged .