1
I have written a simple shell script which uses ncftpput
to recursively upload all directories in a local directory to a remote directory. My shell script, upload.sh
is placed in this local directory and I would like to exclude it from the upload. Is there any way to do this?
ncftpput -R -v -u myUsername -p myPassword myAddress /remoteDir /localDir/*
I have tried doing it like this:
for i in `ls /localDir | grep -v upload.sh`; do
ncftpput -R -v -u myUsername -p myPassword myAddress /remoteDir /localDir/$i
done
But directories with spaces will be considered two directories. E.g. "My Directory" will be considered:
- /localDir/My
- /localDir/Directory
I didn't think of that. That's a simple yet great way to do it. – SimonBS – 2011-12-29T13:07:48.637