FAQs Feed‎ > ‎

Scheduled Backups

posted Jun 26, 2012, 9:14 PM by Mamta Buch   [ updated Sep 22, 2015, 8:16 PM by Chris Aaker ]
This is a page showing some sample lines you can add to a script and some simple instructions on scheduling that script. For full backup and server replacement please look here, Server Replacement

Command to dump all NMS configuration except CDR's. Useful for daily or weekly backups send off server.

The command below can be run on its own or added to a script. It will dump all data to a .sql file to be used later for input. The command will not drop or add the table to the DB, but just insert. This one also ignore some tables that are larger that shouldn't need to be backed up. CDR's shoudl be handled separately. The end  file will result in the Database name + hostname + the date, example SiPbxDomain_test.netsapiens.com_2010_10_15_10_41.sql

mysqldump -p<PASSWORD> -u<USER> SiPbxDomain --ignore-table=SiPbxDomain.cdr \

--ignore-table=SiPbxDomain.subscriber_cdr --ignore-table=SiPbxDomain.audit_log --ignore-table=SiPbxDomain.callqueue_stat_cdr_helper \

--ignore-table=SiPbxDomain.rejected --ignore-table=SiPbxDomain.status --ignore-table=SiPbxDomain.status_workers --ignore-table=SiPbxDomain.huntgroup_stats \

 --ignore-table=SiPbxDomain.filejournal --ignore-table=SiPbxDomain.time_zone_transition   > SiPbxDomain_`hostname`_`date +%Y_%m_%d_%H_%M`.sql

Additionally for NMS you might want to backup any Audio files from /usr/local/NetSapiens/SiPbx/data directory. 

Command to dump all NMS  CDR's. Useful for daily or weekly back send off server.

The command below can be run on its own or added to a script. It will dump all data to a .sql file to be used later for input. This command will only dump data, no structure commands, and will only read the cdr table. It also uses insert ignore which means the created file will be safe to insert over the existing table as duplicate info will be ignored. It is set to only pull the last 25 hours (1 hour buffer) and should be run nightly during a maintenance window. The end  file will result in the Database name + hostname + the date, example SiPbDomain_CDR_test.netsapiens.com_2010_10_15_10_41.sql 

mysqldump -p<PASSWORD> -u<USER> SiPbxDomain cdr --skip-add-drop-table --no-create-info --insert-ignore \

--where='cdr.time_release > DATE_SUB( UTC_TIMESTAMP( ) , INTERVAL 25 HOUR )' > SiPbxDomain_CDR_`hostname`_`date +%Y_%m_%d_%H_%M`.sql

Command to dump all NCS configuration and CDR's. Useful for daily or weekly backups send off server.

The command below can be run on its own or added to a script. It will dump all data to a .sql file to be used later for input. The command will not drop or add the table to the DB, but just insert. This one also ignore some tables that are larger that shouldn't need to be backed up. The end  file will result in the Database name + hostname + the date, example NcsDomain_test.netsapiens.com_2010_10_15_10_41.sql

mysqldump -p<PASSWORD> -u<USER> NcsDomain --skip-add-drop-table --no-create-info  > NcsDomain_`hostname`_`date +%Y_%m_%d_%H_%M`.sql


Command to dump all NDP configuration. Useful for daily or weekly backups send off server.

The command below can be run on its own or added to a script. It will dump all data to a .sql file to be used later for input. The command will not drop or add the table to the DB, but just insert. This one also ignore some tables that are larger that shouldn't need to be backed up. The end  file will result in the Database name + hostname + the date, example NpdDomain_test.netsapiens.com_2010_10_15_10_41.sql

mysqldump -p<PASSWORD> -u<USER> NdpDomain --skip-add-drop-table --no-create-info --ignore-table=NdpDomain.ndp_syslog > NdpDomain_`hostname`_`date +%Y_%m_%d_%H_%M`.sql


Additionally for NDP you might want to backup any firmware from /usr/local/NetSapiens/ndp/frm directory. 

TAGS: server related, scheduled backups, backups, commands, dump configurations, how to, instructions
Comments