I want to FTP all files from a folder except for the ones whose name are specified.
I am using Mget *.* to FTP all files. I think I just need to modify the Mget Command to include some parameter.
Run a job like this either locally or remotely depending on which way the ftp is going. It may not work exactly as written, but it's how I would approach it.
#!/bin/sh
# get single column list of files to exclude
echo $@ | tr " " "\012" > ../exception.lst
tar -cf ../tmp.tar exception.lst .
then ftp the .tar file, then untar it. In one of the other posts a while back someone wrote how to use ftp in a script, but I forgot which one.
You could also use 'find . -type -f -print | fgrep -v -f exception.lst > include.lst', then 'tar -cf tmp.tar `cat include.lst`'
Note there's a limit to how many entries 'fgrep -f' can handle. I forget what it is. (Like 255 or something.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.