The procedure below will make use of the Cron (time based job scheduler) to extract current IMSVA configuration and to run a script to transfer the configuration to your FTP server.
- SSH to the IMSVA server and login as "root".
- Run the following command to create the ftpshare directory:
mkdir -p /root/ftpshare
- Go to the directory:
cd /root/ftpshare
- Create the script by running this command:
vi ftpscript.sh
- Press the 'I' key to go to the inset mode.
- Copy the following script on the "Insert" mode:
#!/bin/sh
# Put FTP server details and credentials here
SERVER="X.X.X.X"
USERNAME="yourusername"
PASSWORD="yourpassword"
cd /root/ftpshare
# login to remote server
ftp -n $SERVER <<EOF
user $USERNAME $PASSWORD
binary
put IMSVAConfigExport`date +\%Y\%m\%d`.dat
quit
EOF
#removes the file from the directory
rm -f IMSVAConfigExport`date +\%Y\%m\%d`.dat
cd - Save the changes and quit by pressing the combination of keys in the order they appear:
[ESC] :wq
- Add permission to execute the script. Run the following command:
cd
chmod a+x /root/ftpshare/ftpscript.sh - Place scripts needed on the Cron tab to schedule when to run:
crontab -e
- Go to the “Insert” mode by pressing the 'I' key.
- Add the following line at the end of all jobs:
0 5 * * * /opt/trend/imss/script/imp_exp.sh -e /root/ftpshare/IMSVAConfigExport$(date +\%Y\%m\%d.dat) /dev/null 2 &1
5 5 * * * /root/ftpshare/ftpscript.sh - This will back up the configuration into the /root/ftpshare/ folder every day at 5:00 AM and send the config to the FTP server at 5:05AM. Save the changes and quit by pressing the combination of keys in the order they appear:
[ESC] :wq
