Processing SMA config M100V-420DF14148D16EXXXXXX-BF70C4XXXXXX-20230419T103106.xml
Saving M100V-420DF14148D16EXXXXXX-BF70C4XXXXXX-20230419T103106.xml under path /home/etrianti/
Schedule Your Task to Run on a Regular Basis (UNIX/Linux)
Use cron (UNIX/Linux) to kick off the job regularly. Cron is driven by a crontab (cron table) file, a
configuration file that specifies shell commands to run periodically on a given schedule. The crontab files
are stored where the lists of jobs and other instructions to the cron daemon are kept.
UNIX/Linux cron config file typically is in this format:
minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
A good example entry to run this script every day at 1:00 AM looks like:
00 01 * * * /home/etrianti/sma_backup.sh
Troubleshoot
Use cli_logs to review whether the script took place correctly and evaluate what has been performed:•
User <admin> login defines that user was able to log in successfully on SMA.1.
executed batch command: 'saveconfig 2' reveals the command which has been executed on the script to save
the configuration.
2.
scp -f /configuration/<SMA_configuration> defines the configuration that fetched from SMA 3.
Example of a successful call of the script:
sma01.local> tail cli_logs
Press Ctrl-C to stop.
Thu Apr 20 12:25:33 2023 Info: PID 61539: User admin login from 10.61.94.7 on 172.16.200.30
Thu Apr 20 12:25:34 2023 Info: PID 61539: User admin executed batch command: 'saveconfig 2'
Thu Apr 20 12:25:39 2023 Info: PID 61582: User admin login from 10.61.94.7 on 172.16.200.30
Thu Apr 20 12:25:39 2023 Info: PID 61582: User admin executed batch command: 'scp -f /configuration/M100V-420DF14148D16EXXXXXX-BF70C4XXXXXX-20230419T103106.xml'
Add command set -x in the top of the script, to enable debug mode in bash and confirm script run
properly. The command set allows you to enable certain flags in your Bash script so that the script
has certain behaviors and characteristics.
•
Caution: SMA with "welcome" message configured under CLI >
adminaccessconfig for appliance administration login, does not allow script to run SCP. In this case welcome
message must be removed, while there is no issue with the banner message.