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

Author Message
Guest1970

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Directory timestamps are not even considered for the synchronization. Only file timestamps.

What does it even mean when a directory timestamp changes?
Guest1970

Guest


prikryl 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
Guest




I made a mistake when I posted the script.

get *<5N localpath

should be

get *<1N localpath


Thanks
Will
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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).
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License