
# Ensure the script does not stop if connection errors occur
option batch continue
# Keeps retrying indefinitely until the connection is restored
option reconnecttime 9999
# Open FTP connection
open ftp://admin:ramini6z@192.168.1.4
# Set local and remote directories for OneDrive backup
lcd "C:/Users/nuvsj/OneDrive"
cd "/HPX360_fullbackup/OneDrive"
# Keepalive workaround: upload a small file to maintain the session
put "C:/Users/nuvsj/OneDrive/Desktop/keepalive.txt" "/HPX360_fullbackup/OneDrive"
# Synchronize: Copy only new and modified files
synchronize remote -criteria=size -delete
# Ensure directory change is explicit before the next sync
cd "/"
lcd "C:/Users/nuvsj/Downloads"
cd "/HPX360_fullbackup/Downloads"
# Keepalive workaround again before syncing
put "C:/Users/nuvsj/OneDrive/Desktop/keepalive.txt" "/HPX360_fullbackup/Downloads"
# Synchronize: Copy only new and modified files
synchronize remote -criteria=size -delete
close
# Exclude specific directories from being backed up
# -filemask="|gdrive/;produced/"
# Resume any unfinished transfers
# put -resume *
# Exit the script
# exit
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="C:\Users\nuvsj\OneDrive\Desktop\HPX360 to WD-script.txt" /log="C:\Users\nuvsj\OneDrive\Desktop\HPX360 to WD.log"
exit