Creating / Running backups from the command line

I am looking to create, run and copy over backups via ansible from multiple systems.

Is it possible to create a backup from the command line? Is it possible to run a backup from the command line?

Is there anywhere I can see examples of this? I have tried googling this but not coming up with anything definitive.

Running the following

/var/lib/asterisk/bin/backup.php
backup.php

options:
–id= - a valid backup id
–astdb=<restore|dump> - dump or restore the astdb
–data= a serilialized string of the astdb dumb to restore.
Can also point to a file contianing the serializes string

/var/lib/asterisk/bin/backup.php --astdb=dump
Array

I think you can do this from fwconsole with the backup option,

Run a backup: fwconsole backup --backup [backup-id]
Run a restore: fwconsole backup --restore [/path/to/restore-xxxxxx.tar.gz]
List backups: fwconsole backup --list
Dump remote backup string: fwconsole backup --dumpextern [backup-id]
Run backup job with remote string: fwconsole backup --externbackup [Base64encodedString]
Run backup job with remote string and custom transaction id: fwconsole backup --externbackup [Base64encodedString] --transaction [yourstring]
Run backup on a single module: fwconsole backup --backupsingle [modulename] --singlesaveto [output/path]
Run a single module backup: fwconsole backup --restoresingle [filename]

Please refer to https://wiki.freepbx.org/pages/viewpage.action?pageId=91357370#fwconsolecommands(15+)-Backup

Meant to say most of them are freepbx 13 so the “fwconsole backup” isn’t available (that I can see), hence trying to use the php method

Schedule a backup using the GUI and then look at the cron task generated with

crontab -l -uasterisk
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.