Forum Discussion

Sundaresh_88805's avatar
Sundaresh_88805
Icon for Nimbostratus rankNimbostratus
Sep 15, 2015

Automate Backup

Hi,

I ran the below script to automate the UCS backup. I can see the output moved over FTP when I run the script manually. However, when I schedule in cronjob, I am not seeing the file moved in FTP server, but the file is created /var/tmp. Please advise.

!/bin/bash

export a=

date +"%y%m%d"
export aa=$HOSTNAME.$a tmsh save /sys ucs $aa export b=/var/tmp/$aa.ucs mv /var/local/ucs/$aa.ucs $b FILE="xyz.$a.ucs"

ftp -n IP <

Regards, Sundaresh

3 Replies

  • if you format the script so i can test it ill gladly do that. it might be something that via cron some things don't work then we you run it directly. if you google that you might find some hints.
  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus
    Could it be the permission assigned to the cronjob itself? Assume when you run it manually you are running as Root. Just a thought
  • I did thought it could be a permission issue. But I checked login as root and user both. but no luck.