Views:

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.

  1. SSH to the IMSVA server and login as "root".
  2. Run the following command to create the ftpshare directory:

    mkdir -p /root/ftpshare

  3. Go to the directory:

    cd /root/ftpshare

  4. Create the script by running this command:

    vi ftpscript.sh

  5. Press the 'I' key to go to the inset mode.
  6. 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

  7. Save the changes and quit by pressing the combination of keys in the order they appear:

    [ESC] :wq

  8. Add permission to execute the script. Run the following command:

    cd
    chmod a+x /root/ftpshare/ftpscript.sh

  9. Place scripts needed on the Cron tab to schedule when to run:

    crontab -e

  10. Go to the “Insert” mode by pressing the 'I' key.
  11. 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

  12. 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