Hi, i am just looking for a solution, backing up my pi over my network. I have a windows server, which only starts for backup routines.
What i would like to do is the following scenario:
Every night the bigtimer node is waking up the windows pc via wol (works fine).
After a delay with the bigtimer node, the RasPi should mount the windows share and backing up itself to the shared folder. When it`s done, windows is shutting down.
Manually sharing via cifs works fine (sudo mount -t cifs //windows-server/e /media/backup-ssd -o username=user,password=password,rw,file_mode=0777,dir_mode=0777,vers=1.0) but not within nodered by using the exec node (./home-server-mount.sh).
content of the script:
#!/bin/bash
sudo mount -t cifs //windows-server/e /media/backup-ssd -o username=user,password=password,rw,file_mode=0777,dir_mode=0777,vers=1.0
exit
The result is an error (126).
IĀ“m new with nodered and being thankful for hints. Maybe there are other ideas for doing such a job.
I agree here - just because we have a hammer - not every problem is a nail.
Setup a cron job to run your script (as root) - then append whatever additional commands (after a suitable pause) that you wish to use to perform the backup
You could also install the WSL (subsystem for Linux) on windows and then use Rsync to perform an incremental backup to the machine over SSH
No need for WSL for this. You can get SSH & RSYNC for Windows natively too. There are also SSH based backup tools that will do the job. Indeed there are plenty of tools that will do this.
At the end, the backup itself should not be a big challenge. I love nodered and i am about to use it as a "swiss army knife". But as TotallyInformation wrote, "you shouldn't assume to use it for everything!". The only challenge i see, is the synchronizing of the cron job and the startup flow for the windows computer (i only want to start for the backup). At the end it should work like this: Windows starting at 4 am (nodered), on 4.10 am the cron job is mounting the windows share on the PI and starts the backup. After that (5 am) the backup share is gonna be unmount and the windows computer is shutting down. Easy in theory
That is also easy - there are well trodden paths for this kind of thing (helps if you know computing history!).
In your CRON job, include the creation/update of a file containing a machine readable timestamp (I recommend ISO format). Then your flow can read the file & make sure that the timestamp is current before continuing - if it isn't, you can delay it by a couple of minutes and loop.