Hyper Backup: initiating backup from Vault target ("remote start")

Currently reading
Hyper Backup: initiating backup from Vault target ("remote start")

3
1
NAS
DS916+, DS220j
Operating system
  1. Linux
Last edited:
I have a primary NAS (a DS916+) backing up to a secondary device offsite (a DS220j); both running latest DSM 7. They are connected "directly" to each other via Tailscale with a scheduled backup from the primary to the offsite. (aside: they're both behind SOHO routers/gateways, with the usual home ISP NAT and no port forwarding; Tailscale is able to establish direct connections through the dual-NAT, not using a relay, which is great - it's as fast as the pipes permit. Highly recommend Tailscale over QuickConnect, OpenVPN or whatever tunnel solution you might be using. And it's free for this type of use case, with excellent documentation and good community support!)

The above is working great so far.

Now I'd like to leave the offsite device powered off most of the time, and have it power on to a schedule, initiate a backup, and then power off when the backup is complete. This means I need to be able to have the offsite NAS initiate a backup on the primary, rather than use a schedule defined on the primary. (of course, I could just arrange the offsite's power schedule with the primary's backup schedule, but where's the fun in that? :) )

BTW, the reason for the "powered off most of the time" is for noise, not so much the modest energy savings: the offsite NAS is in an environment where I'd prefer to not have it running when it's not needed. The DS220j is pretty quiet but still not totally silent, esp. the drives can be quite loud.

Is it possible to initiate a HB backup remotely, other than clicking the "Backup Now" button on the web UI?
 
Last edited:
I fail to see what is so difficult about this. There's no reason that I see why you cannot use what is already programmed into DSM. Access your remote NAS, go to Control Panel, Hardware and Power, Power Schedule and create both a startup and shutdown schedule. Then schedule your local NAS to perform the backup to the remote starting about 5mins later then the remote is set to startup. Have the power down of the remote scheduled for say 30 later than the average time it takes to complete a backup. No need to write complicated scripts. Also, depending on the when and where, you can disable system beeps on the remote to keep from disturbing others.
 
Last edited:
@Pauljw - the reason for not wanting to use the schedules is due to the guesswork involved: I have to guess how long it'll take the NAS to boot and be ready for incoming connections, and guess how long it'll take to complete. The former isn't a real issue, the latter is the kicker. I hope the NAS won't shutdown when a backup is in progress so maybe I can just schedule a bunch of shutdowns at intervals over the when I think it might finish.

It would be nice to not have to guess; I have considered the other solutions below but given my available time, will just go with guessing ;-).

Possible approaches:

- and perhaps this is the simplest (for me, as a unix person):
- set the offsite to power on whenever (alas, I don't have a means to send wake-on-LAN)
- on the offsite NAS: power on task to ssh to the primary and kick off a backup (via the synobackup command); then monitor the backup and shutdown when it's complete
 
It sounds like you have been doing backups to this unit, so you should have logs telling you how long each backup took, just average the longer ones and cushion it. I would think allowing an hour would be more than enough, but you should have the info available to make a very educated "guess." These things don't really use all that much power so even leaving it up for 2hrs isn't that expensive. I have no idea of how much of what sort of data you're talking about or how often you intend to do backups. And if you don't think 5mins is enough to get the remote up and running, make it 10. Once you get the original "guessing" done, it's pretty much a set and forget scenario. Do you have the remote on a ups to protect against power outages?

Best of luck in your decision, I just wanted to you to realize there was a pretty simple method already available if you didn't know about it.🙂
 
Last edited:
So I fiddled around with this and came up with the following:

Recap - the scenario:
  • a primary NAS (a DS916+) is on all the time
    • needs to be backed up to somewhere offsite 1-2 times per week
  • a 'secondary' NAS to be used as the backup Vault is offsite
  • goal is to
    • leave the offsite off most of the time (for noise reasons, not so much power consumption)
    • initiate a backup on the primary whenever the offsite becomes available
    • shutdown when the backup is complete
    • avoid guessing:
      • avoid having to coordinate power-on and backup times
      • avoid having to guess as to how long a backup might take


The solution:
  1. arrange the two NAS such that the offsite NAS can ssh to the primary NAS
    1. highly recommend Tailscale
  2. install the scripts in the gist below on both the offsite and primary NAS
    1. do_backup.sh on the primary to-be-backed-up NAS
    2. pull_backup.sh on the offsite NAS
  3. configure the offsite NAS to run the pull_backup.sh script on boot (Task Scheduler)
    1. run the pull_backup.sh script manually once, with any argument (e.g. pull_backup.sh 1), to install the ssh host key
  4. configure the offsite NAS to power on at whatever backup schedule you'd like, e.g. couple of times a week

  • the offsite NAS will only shutdown on a completed backup, e.g. if the backup task fails to launch it'll stay on to allow you to investigate what happened

Some may see this as more complicated than simply aligning task schedules, I see it as being able to automatically accommodate varying backup sizes and failure modes. And yes, there are still arbitrary delays in there to accommodate Synology. I Regret Nothing ;-)

PS: if you're more adventurous than I, you could strip out most of the 'resiliency' parts of these scripts down to about four lines apiece...

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

View: https://gist.github.com/bdlow/331f3e52c289a5cbeab44dd945b3d487
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Unfortunately, HB does not support QC. It's either, a public IP, DDNS, or LAN IP.
Replies
1
Views
374
  • Question
That will work with 4.1 version. Looks like user feedback has been implemented.
Replies
4
Views
1,212
You are welcome! Glad that you got it eventually working. You can still create a Synology support ticket...
Replies
11
Views
1,997
Well in a way this is expected. Your DSM6 machine (host) is still on an older version and anything other...
Replies
1
Views
651
  • Question
A bit odd tbh. Not sure how the name could be a factor here as Synology doesn't have a list of all bucket...
Replies
4
Views
1,121
Not sure what to say... I have about 5-6 separate tasks towards C2 and not a single time on any of them...
Replies
3
Views
1,379
Sorry, I do not know how to write a script for this but I am confused and have a question. Maybe there is...
Replies
1
Views
1,001

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top