However for me the solution that @PitzKey pointed out is not working. In fact looking at the backup log I am not even seeing the job attempting to run the post-hook script.
...
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Cleaning up data generated by Recording_report [] []
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.DEBUG]: Removing /tmp/recording_report_dump [] []
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Cleaning up data generated by Sms [] []
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.DEBUG]: Removing /tmp/sms_dump [] []
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Finished Cleaning up [] []
[2023-05-16 08:11:36] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Finished created backup file: 20230516-081039-1684242639-16.0.40.1-1626155333.tar.gz [] []
[2023-05-16 08:11:37] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Saving to selected Filestore locations [] []
[2023-05-16 08:11:40] [b3e6293d-c94c-4eb4-b53d-76b843108448.DEBUG]: Saving to: SSH:'spare' instance ,File location: /var/spool/asterisk/backup/20230516-081039-1684242639-16.0.40.1-1626155333.tar.gz [] []
[2023-05-16 08:11:40] [b3e6293d-c94c-4eb4-b53d-76b843108448.INFO]: Finished Saving to selected Filestore locations [] []
Am I just dense or is anyone else experiencing the issue?
I followed your advice from a couple of years ago and created a folder in the root of the system and gave the asterisk user permissions to it but the logs aren’t even showing that it’s trying to run the script.
Running the script manually from the CLI works just fine.
ls -al /container/
total 4
drwxr-xr-x 2 asterisk asterisk 31 May 16 08:07 .
dr-xr-xr-x. 19 root root 284 May 16 08:07 ..
-rwxr-xr-x 1 asterisk asterisk 390 May 15 11:50 disable_trunks.sh
Screenshot of the relevant portion of the warm spare backup configuration:
#!/bin/bash
# Date created: 05/13/2023
# Version: 1
# A script that disables asterisk trunks on the warm spare since this is not currently
# supported by the PBXact Warm Spare backup functionality.
/usr/bin/ssh -i /home/asterisk/.ssh/id_rsa [email protected]<warm spare IP> /usr/sbin/fwconsole trunks --disable 1
/usr/bin/ssh -i /home/asterisk/.ssh/id_rsa [email protected]<warm spare IP> /usr/sbin/fwconsole reload
After looking at the backup/restore logs, I noticed that the Post-Restore script runs directly on the machine that is being restored. That is where it should be created.
If you store the script locally on Restore Target at path /home/asterisk/sample_file.sh , then you should write in Post-Restore Hook “/home/asterisk/sample_file.sh”.
I would suggest to first try with sample script to test functionality eg.
[[email protected]] # cat /home/asterisk/test_message_after_restore.sh
#!/bin/sh
echo "$(date) - This is a test" >> /home/asterisk/test.log
Make sure owner:group is asterisk:asterisk and executable by asterisk.