The following seems to work well to clear the Asterisk database: service asterisk stop sqlite3 /mnt/kd/astdb.sqlite3 'delete from astdb;' service asterisk start
Easy to clear out the cdr database the same way (not sure if you need to stop Asterisk though) sqlite3 /mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 'delete from cdr;' sqlite3 /mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 'VACUUM;' Thanks! Regards Michael Knill On 5/7/18, 9:51 am, "Michael Knill" <michael.kn...@ipcsolutions.com.au> wrote: Thanks Lonnie. Simple! Add 'service asterisk stop' to any restore or factory reset script and all is resolved after a reboot. Regards Michael Knill On 5/7/18, 9:24 am, "Lonnie Abelbeck" <li...@lonnie.abelbeck.com> wrote: > On Jul 4, 2018, at 5:23 PM, Michael Knill <michael.kn...@ipcsolutions.com.au> wrote: > > Does anyone know if there is an issue with writing or deleting entries directly in the astdb.sqlite3 database rather than via Asterisk? > It would only be used for backup/restore/factory reset purposes. I would not do that if Asterisk is running. If you need to change astdb.sqlite3 entries, do it via Asterisk. As part of my tarsnap daily backups, my /mnt/kd/tarsnap-backup.script contains ... -- sqlite3 /mnt/kd/astdb.sqlite3 .dump > "$CUSTOM_BACKUP_DIR/astdb.sqlite3.dump" -- Ref: https://doc.astlinux-project.org/userdoc:tt_tarsnap_online_backup#optional_action_script Then any restore would need to be done when Asterisk is not running. Lonnie ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Astlinux-users mailing list Astlinux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to pay...@krisk.org. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Astlinux-users mailing list Astlinux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to pay...@krisk.org. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Astlinux-users mailing list Astlinux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to pay...@krisk.org.