Upload new files if remote destination is empty


United States

Upload new files if remote destination is empty


I have a SFTP server where my clients send me files on a daily basis.

The current setup is:
My SFTP runs a bash script that takes each /home/$USER$/upload folder and archives any files in /home/$USER$/upload/* into the cloud. The bash script creates a $USER$/YYYY-MM-DD/ folder in the cloud and puts the files in there.

The bash script then clears the /upload folder after each run.
The run happens in 1AM as a cronjob.

This results in:
etc etc.

Most clients are okay with this and know how to follow instructions.
However, one client is uploading syncing his whole folder using a WinSCP script.
Therefore, I'm getting his old files + new files.

This is adding up space as each folder contains old files + new files.

He only needs to send me newly created files.

I told him to send me his winscp script and I can glance at it.

Here is his script:
# **********************************************************************
# Batch Mode On
option batch on
# Confirm Off
option confirm off
# **********************************************************************
# ***********************************************************************
# Connects to Server
synchronize remote
# **********************************************************************
# Disconnect from Server
# Exit WinSCP
# **********************************************************************
How can I make WinSCP aware to upload new files that were created in his local folder?
(Remember, my side (the SFTP server), clears his /upload folder every night.
We do not hold his old files in the /upload/ folder for security.

How can I modify his script so it's aware of what to send?

Thanks in advance,

Reply with quote



You can post new topics in this forum