You are on page 1of 2

"UDH",

"TextDecoded",
"Coding",
"Class"
) SELECT
CURRVAL(pg_get_serial_sequence('outbox','ID')),
2,
'050003D30202',
's nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.',
'Default_No_Compression',
-1;

INSERT INTO user_outbox (


id_outbox,
id_user
) SELECT
CURRVAL(pg_get_serial_sequence('outbox','ID')),
1;

Note: Adding UDH means that you have less space for text, in above example you can use only 153 characters in
single message.

156 | SMSEagle NXS-9700 | User’s Manual


Database cleaning scripts

We have added some useful scripts which may be used to delete SMS messages from database through
Linux CLI.
Scripts are located at following directory:
/mnt/nand-user/scripts/

• db_delete – script for deleting SMS from folders Inbox, SentItems older than provided date.
Usage:
./db_delete YYYYMMDDhhmm

• db_delete_7days – script for deleting SMS from folders Inbox, Sentitems older than 7 days.
Usage:
./db_delete_7days

• db_delete_allfolders – script for cleaning PostgreSQL database folders (Inbox, SentItems,


Outbox). Specially designed to run periodically through cron. Usage:
./db_delete_allfolders

• db_delete_select - script for deleting SMS from chosen databse folder (Inbox, Outbox,
SentItems, Trash). Usage:
./db_delete_select {inbox|outbox|sentitems|trash}

Adding script to system cron daemon


1) Create a file inside /etc/cron.d/ directory with your desired name (eg. pico db_cleaner)
2) Example content of this file:
0 0 1 * * root /mnt/nand-user/scripts/db_delete_allfolders

This will run cleaning script every 1st day of month.

157 | SMSEagle NXS-9700 | User’s Manual

You might also like