CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

Advertisement

Guest1970
Guest

CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

Hello,

I am trying to Get subfolders/files that are older than x minutes. I have noticed that if the root folder modify date has changed and there are subfolders/files that are older than x, no files are downloaded.

Is there a way to still get the subfolders/files that are older even if the root folder modify date has changed.

Thanks
Wll

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

Directory timestamps are not even considered for the synchronization. Only file timestamps.

What does it even mean when a directory timestamp changes?

Reply with quote

Guest1970
Guest

Re: CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

martin wrote:

Directory timestamps are not even considered for the synchronization. Only file timestamps.

What does it even mean when a directory timestamp changes?

Thanks for the Reply,

When I create either a subfile or subfolder under the root folder the time stamp of the root folder changes to the date/time of the lastest file/folder that was created.

Root folder:
drwxrws---+ 7 root Test 168 Dec 23 11:17 12-23-2015

Subfolders under 12-23-2015 folder
drwxrws---+ 2 root Test 48 Dec 23 10:00 test1
drwxrws---+ 2 root Test 48 Dec 23 10:00 test2
drwxrws---+ 2 root Test 48 Dec 23 11:17 Test3


If I run the script at 11:17, looking for files/folders modify time > 1 minute, I would expect folders test1 and test2 should be downloaded and not test3. No files are downloaded until the root folder's (/Data/Test) modify date > 1 minute.


script:

open sftp://user@server -privatekey=privatekey.ppk
option confirm off
lcd local path
cd /Data/Test
get *<5N localpath
close
exit


Thanks
Will

Reply with quote

Guest

Re: CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

I made a mistake when I posted the script.

get *<5N localpath

should be

get *<1N localpath


Thanks
Will

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: CLI: Get subfolders/files that are older than x minutes even if root folder mod date has changed

You want this

get * -filemask=*<1N localpath

It makes WinSCP recuse into all subdirectories (the *), but download only the files that are at least one minute old (the -filemask=*<1N).

Reply with quote

Advertisement

You can post new topics in this forum