Fix
This commit is contained in:
+13
-3
@@ -15,7 +15,7 @@ set -e # Exit if error
|
||||
# =============================================================================
|
||||
FTP_USER=card
|
||||
FTP_PASS=card
|
||||
FTP_IP=192.168.1.21
|
||||
FTP_IP=192.168.1.30
|
||||
FTP_PORT=2121
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ DESTINATION=Card/ # Local folder where to save files
|
||||
# will saved FTP folder "/distant/dir" in local folder "$DESTINATION/dir2"
|
||||
|
||||
LINK=()
|
||||
LINK+=("DCIM" "DCIM")
|
||||
LINK+=("Download" "Download")
|
||||
|
||||
|
||||
@@ -35,14 +36,23 @@ LINK+=("Download" "Download")
|
||||
|
||||
|
||||
# =============================================================================
|
||||
echo "Start synchronisation"
|
||||
echo "========================================================="
|
||||
echo "Start synchronisation to ${DESTINATION}"
|
||||
echo "========================================================="
|
||||
find ${DESTINATION} -type f -exec chmod 644 {} \;
|
||||
find ${DESTINATION} -type d -exec chmod 755 {} \;
|
||||
|
||||
for ((i=0; i<${#LINK[@]}; i+=2)); do
|
||||
DISTANT_DIR=${LINK[i]}
|
||||
LOCAL_DIR=${LINK[i+1]}
|
||||
echo "############################## ${DISTANT_DIR} > ${LOCAL_DIR}"
|
||||
mkdir -p "${DESTINATION}/${LOCAL_DIR}/"
|
||||
|
||||
lftp ftp://${FTP_USER}:${FTP_PASS}@${FTP_IP}:${FTP_PORT} -e "mirror -e -x .thumbnails -x "saved" \"${DISTANT_DIR}\" \"${DESTINATION}/${LOCAL_DIR}\" ; quit"
|
||||
if lftp ftp://${FTP_USER}:${FTP_PASS}@${FTP_IP}:${FTP_PORT} -e "mirror -e -x .thumbnails -x "saved" \"${DISTANT_DIR}\" \"${DESTINATION}/${LOCAL_DIR}\" ; quit" ; then
|
||||
echo "Success :)"
|
||||
else
|
||||
echo 'Failed !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user