@madbrain said in Automate full config backups from a pfSense to a Synology NAS on the same network:
The command I posted yesterday did not work. It produced 0 byte files. Turns out logging in to pfSense+ 24.11 via ssh presents the user with a menu. One needs to select option 8 before executing any command. Is there any cleaner way than forcing the input of 8 + LF before the command ?
Aha .... Let "AI" the thing ... 😊
What about these 4 keywords ? :
pfsense ssh backup config
Use the very first Alternate Remote Backup Techniques | pfSense ... solution proposed.
Over there, 3 solutions. the last one, Basic SSH backup will interest you.
edit : ok ... stupid me, this link was already given above. But take note : no "menu" issues for me.
Still, this doesn't work for me, as I'm using this :
43f98ab9-41ef-4a0d-bd40-e98da3c073eb-image.png
so no root (admin) password is asked, but a key passphrase is needed.
After placing my pfsense private key in some '.ssh' directory (name : pfsense.key) I could use
Christian@DiskStation2:~/.ssh$ ssh -i /var/services/homes/Christian/.ssh/pfsense.key root@192.168.1.1 cat /cf/conf/config.xml > backup.xml
Enter passphrase for key '/var/services/homes/Christian/.ssh/pfsense.key': ############
Now I have the config file "backup.xml" on my NAS :
Christian@DiskStation2:~/.ssh$ ll backup.xml
-rw------- 1 Christian users 639484 Feb 20 08:41 backup.xml
Look at this if you want to automate it 100 % (somewhat not secure)