im Log sehe ich immer folgende Zeilen - die ja eigentlich per exclude garnicht kopiert werden sollte...:
Code: Alles auswählen
pget: Access failed: 550 .AppleDouble: not a plain file.
Code: Alles auswählen
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='192.168.1.1'
USER='backup'
PASSWORD='ganz sicher!'
# DISTANT DIRECTORY
REMOTE_DIR='/hugo'
#LOCAL DIRECTORY
LOCAL_DIR='/share/MD0_DATA/Hugo_Sync'
#LOCKFILE
LOCKFILE=/opt/scripts/backup_hugo.lock
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
echo "already running"
exit
fi
Exclusions=(
--exclude-glob=.DS_Store/
--exclude-glob=.Trash/
--exclude-glob=.TemporaryItems/
--exclude-glob=._*
--exclude-glob=.AppleDB/
--exclude-glob=.AppleDouble/
--exclude-glob=__MACOSX/
--exclude-glob=.AppleDesktop/
--exclude-glob=.~lock*
--exclude-glob=.fseventsd
--exclude-glob=.lock
--exclude-glob=.afpDeleted*
--exclude-glob=.smbdelete*
--exclude-glob=.TEMP_*
--exclude-glob=@eaDir
--exclude-glob=Thumbs.db
--exclude-glob='* '
--exclude-glob='*.'
)
# RUNTIME!
echo
echo "Starting download $REMOTE_DIR from $HOST to $LOCAL_DIR"
date
lftp -u "$USER","$PASSWORD" $HOST <<EOF
# the next 3 lines put you in ftpes mode. Uncomment if you are having trouble connecting.
# set ftp:ssl-force true
# set ftp:ssl-protect-data true
#set ssl:verify-certificate no
set ftp:ssl-allow false
set ftp:passive-mode true
# transfer starts now...
#set sftp:auto-confirm yes
mirror -s "${Exclusions[@]}" --delete --use-pget-n=3 $REMOTE_DIR $LOCAL_DIR;
exit
EOF
echo
echo "Transfer finished"
date
# make sure the lockfile is removed when we exit and then claim it
trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
echo $$ > ${LOCKFILE}
# do stuff
sleep 1000
rm -f ${LOCKFILE}