Ensure that only newer files will be synchronized, no matter which size they have

This commit is contained in:
2025-11-18 12:20:06 +01:00
parent 3a6c4e28b3
commit b933b1900d
+4 -4
View File
@@ -131,25 +131,25 @@ if ping -c 1 $SERVER_IP &>/dev/null; then
log "⬆️ Uploading Darktable DB to Server..."
UPLOAD_LOG1=\$(mktemp)
rsync -avh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$LOCAL_DARKTABLE_DB_DIR/" "$SERVER_USER@$SERVER_IP:$SERVER_DB_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$UPLOAD_LOG1"
rsync -uavh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$LOCAL_DARKTABLE_DB_DIR/" "$SERVER_USER@$SERVER_IP:$SERVER_DB_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$UPLOAD_LOG1"
SENT1=\$(count_synced_files "\$UPLOAD_LOG1" "up")
rm "\$UPLOAD_LOG1"
log "⬆️ Uploading photos to Server..."
UPLOAD_LOG2=\$(mktemp)
rsync -avh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$LOCAL_PHOTO_DIR/" "$SERVER_USER@$SERVER_IP:$SERVER_PHOTO_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$UPLOAD_LOG2"
rsync -uavh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$LOCAL_PHOTO_DIR/" "$SERVER_USER@$SERVER_IP:$SERVER_PHOTO_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$UPLOAD_LOG2"
SENT2=\$(count_synced_files "\$UPLOAD_LOG2" "up")
rm "\$UPLOAD_LOG2"
log "⬇️ Downloading DB back from Server..."
DOWNLOAD_LOG1=\$(mktemp)
rsync -avh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$SERVER_USER@$SERVER_IP:$SERVER_DB_DIR/" "$LOCAL_DARKTABLE_DB_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$DOWNLOAD_LOG1"
rsync -uavh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$SERVER_USER@$SERVER_IP:$SERVER_DB_DIR/" "$LOCAL_DARKTABLE_DB_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$DOWNLOAD_LOG1"
RECEIVED1=\$(count_synced_files "\$DOWNLOAD_LOG1" "down")
rm "\$DOWNLOAD_LOG1"
log "⬇️ Downloading photos from Server..."
DOWNLOAD_LOG2=\$(mktemp)
rsync -avh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$SERVER_USER@$SERVER_IP:$SERVER_PHOTO_DIR/" "$LOCAL_PHOTO_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$DOWNLOAD_LOG2"
rsync -uavh --itemize-changes -e "ssh -p $SERVER_SSH_PORT" "$SERVER_USER@$SERVER_IP:$SERVER_PHOTO_DIR/" "$LOCAL_PHOTO_DIR/" 2>&1 | tee -a "\$SYNC_LOG" "\$DOWNLOAD_LOG2"
RECEIVED2=\$(count_synced_files "\$DOWNLOAD_LOG2" "down")
rm "\$DOWNLOAD_LOG2"