ManagerJay
IS-IT--Management
I have written the following script to upload a small amount of data from our Regional Offices to our Headquarters office each night.
Backup_Name=`date | cut -c 1-3,5-7,9-10,25-28`.$HOSTNAME.tgz
tar -cvzf "/$Backup_Name" /users
ftp -n -i XXX.XXX.XXX.XXX <<SCRIPT
user XXXXXX XXXXXX
bi
put "/$Backup_Name" "$Backup_Name"
bye
SCRIPT
rm "/$Backup_Name" -f
The tar file is created and the data is transferred to the headquarters server, but the tar file created is not deleted.
Any ideas why the rm command is not running and what should be done to make it run correctly.
TIA,
Jay
Backup_Name=`date | cut -c 1-3,5-7,9-10,25-28`.$HOSTNAME.tgz
tar -cvzf "/$Backup_Name" /users
ftp -n -i XXX.XXX.XXX.XXX <<SCRIPT
user XXXXXX XXXXXX
bi
put "/$Backup_Name" "$Backup_Name"
bye
SCRIPT
rm "/$Backup_Name" -f
The tar file is created and the data is transferred to the headquarters server, but the tar file created is not deleted.
Any ideas why the rm command is not running and what should be done to make it run correctly.
TIA,
Jay