FTP - Upload Only New Files - More file extensions

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
marc80
Posts: 4
Joined: 19 Nov 2012 05:49

FTP - Upload Only New Files - More file extensions

#1 Post by marc80 » 19 Nov 2012 05:58

Hi all, I am using Upload Only New Files script http://www.dostips.com/DtCodeBatchFiles.php#Batch.FtpBatchUploadOnlyNewFiles...
I need to upload multiple file types...example .txt .jpg .doc

how can I define this rule in the filter...Set FindStrArgs=/E /C:".txt"?

Thanks in advance

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: FTP - Upload Only New Files - More file extensions

#2 Post by Squashman » 19 Nov 2012 07:51

marc80 wrote:Hi all, I am using Upload Only New Files script http://www.dostips.com/DtCodeBatchFiles.php#Batch.FtpBatchUploadOnlyNewFiles...
I need to upload multiple file types...example .txt .jpg .doc

how can I define this rule in the filter...Set FindStrArgs=/E /C:".txt"?

Thanks in advance


Those are just the predefined arguments for the FINDSTR command. Read the Help file for the findstr command.

Code: Select all

findstr /?

You should be able to do one of the following.

Set FindStrArgs=/I /E /C:".txt" /C:".pdf"
Set FindStrArgs=/I /E ".txt .pdf"

marc80
Posts: 4
Joined: 19 Nov 2012 05:49

Re: FTP - Upload Only New Files - More file extensions

#3 Post by marc80 » 19 Nov 2012 08:35

Great...thank you
Another important thing...
the scipt check if there are any new files to upload ... ok
I would like to check last modified date of the files in the local folder and replace files in the remote folder if they are older

Thanks in advance

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: FTP - Upload Only New Files - More file extensions

#4 Post by foxidrive » 19 Nov 2012 09:03

You will probably find that files on an FTP server take the remote server time as the timestamp when they are uploaded.

They will never be the same timestamp as the local file copies.

marc80
Posts: 4
Joined: 19 Nov 2012 05:49

Re: FTP - Upload Only New Files - More file extensions

#5 Post by marc80 » 19 Nov 2012 09:48

Yes I know....but not creation date....maybe... It is possible to check the last modified date of the file?
There must be a solution to this...

marc80
Posts: 4
Joined: 19 Nov 2012 05:49

Re: FTP - Upload Only New Files - More file extensions

#6 Post by marc80 » 19 Nov 2012 13:02

I would also create a log file to be saved in the local folder with all the operations performed by the script, pretty much what you see in the dos window with the name like 19-11-2012 (PC today's date)

can someone help me please?

m4st3rc1p0
Posts: 5
Joined: 29 Jan 2015 01:57

Re: FTP - Upload Only New Files - More file extensions

#7 Post by m4st3rc1p0 » 29 Jan 2015 02:08

I would like to know if someone has already answers his query as I also need to know how to achieve this via script.

m4st3rc1p0
Posts: 5
Joined: 29 Jan 2015 01:57

Re: FTP - Upload Only New Files - More file extensions

#8 Post by m4st3rc1p0 » 29 Jan 2015 05:19

does anyone know how to do this checking the timestamp and date

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: FTP - Upload Only New Files - More file extensions

#9 Post by foxidrive » 14 Mar 2015 17:00

marc80 wrote:Yes I know....but not creation date....maybe... It is possible to check the last modified date of the file?
There must be a solution to this...


The FTP server may not use any of the NTFS timestamps.

You can test that yourself by uploading a file, and downloading it again, and then compare the creation time/last modifed times etc of both copies.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: FTP - Upload Only New Files - More file extensions

#10 Post by Squashman » 14 Mar 2015 17:21

Timestamps get tricky on ftp servers. I deal with it on a daily basis. Hard to do with a batch file so we use a third party program called WatchFtp.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: FTP - Upload Only New Files - More file extensions

#11 Post by foxidrive » 16 Mar 2015 11:40

Squashman wrote:Timestamps get tricky on ftp servers. I deal with it on a daily basis. Hard to do with a batch file so we use a third party program called WatchFtp.


Sounds reasonable. :)

Zipping into a file or uploading a companion text file with the date-timestamp added in the name could work too.

Post Reply