[SOLVED] sh Script Help - Can't FTP File.

EDIT: Sorry just me having a blank moment, all fixed up now

So i currently have this script, and im looking to backup the tar'd dirs and ftp them to my home server. However when i run the script to file doesnt appear on my home server, but no errors or warnings appear, have run through the script manually line by line and all worked out. Im loggin into the ftp using automatic login with the .netrc file.

#!/bin/sh

BACKUPDIR=/tmp/backup/
FILE=backup-`date +%d-%m-%Y`.tar.gz

if [ -d $BACKUPDIR ];
then
        cd $BACKUPDIR

        if [ -f $FILE ];
        then
                rm $FILE
        fi

        tar -Pczf $FILE /var/www/ /var/mail/ /var/lib/mysql/ /home/
else
        mkdir $BACKUPDIR
        cd $BACKUPDIR
        tar -Pczf $FILE /var/www/ /var/mail/ /var/lib/mysql/ /home/
fi

chmod 777 -R /tmp/backup/
HOST=dev.iwader.co.uk
FTPDIR=/home/wader/backups/vps/velocity/
FTPFILE=/tmp/backup/$FILE

ftp -i $HOST <

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct