Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Unix FTP backup script with resume functions

Avatar of lupadilha
lupadilha asked on
Unix OSStorage SoftwareShell Scripting
1 Comment1 Solution653 ViewsLast Modified:
Hello,
I have a server running FreeBSD and a movie jukebox on unix. I need a script to copy folders from FreeBSD to the movie jukebox.

The script needs to check if the file already exists on the server, resume transfer (if possible) and do not overwrite any files, as it will be running on cron.

I've worked on something like this (based on some answers):

#!/bin/sh

ilockfile = /tmp/lockfile_for_backup_script
REMOTE='example.com'
PORT=20
USER='foob'
PASSWORD='mypassword'
FTPLOG='/var/mylog'

#check if lockfile exists, if it does, exit
if [ -e $lockfile ] ; then
   exit 0
fi

# ok lockfile doesnt exist, lets crate it
touch $lockfile

ftp -n $REMOTE $PORT <<_FTP>>$FTPLOG
quote USER $USER
quote PASS $PASSWORD
bin
cd /home/backups/
mput /home/file/bk*
quit
_FTP

# ok, we are done, remove lockfile
rm -f $lockfile

Basically it's a incremental backup script through FTP but this script does not support resume functions, it only overwrites everything. Can somebody help me out with my solution or provide another solution?

Thanks a lot, do not hesitate in asking further questions.
ASKER CERTIFIED SOLUTION
Avatar of Steven Carnahan
Steven CarnahanFlag of United States of America imageAssistant Vice President\Network Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answers