FTP File Loop and Datetime filter

Discuss RoboTask here
Post Reply
meriturva
Posts: 11
Joined: Thu Oct 18, 2007 3:29 am

FTP File Loop and Datetime filter

Post by meriturva »

Hi!
i'm evaluating this nice program and i need a feature to delete files older than a date. I found this feature into the FileLoop but i don't know how to do it with FTP File Loop.
Any ideas?
 
Thanks
Meriturva
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

FTP File Loop and Datetime filter

Post by Oleg »

See the example below. This example detects files on FTP older than 2 days. Also it uses basic plugin. You can take it here.
We already added system variable {DateIncDays()} which calculates the date +- number of days from current date. New release will be soon.

;*******************************
;* RoboTask Task file
;* Do not edit in text editor!
;*******************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1603713905
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task528"
Hide=INTEGER|0
ID=INTEGER|576843183
Name=STRING|"Old Files on FTP"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|-1
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action1\Params]
expression=STRING|"cstr(DateAdd(""d"",-2,Date()))"
variable=STRING|"OLD_DATE"

[Actions\Action10]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FTP_FILETIME"""
Params=FOLDER

[Actions\Action10\Params]
varname=STRING|"FTP_FILETIME"

[Actions\Action2]
ActionID=STRING|"A_FTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"FTP Log On"
Params=FOLDER

[Actions\Action2\Params]
anonymous=STRING|"1"
host=STRING|"localhost"
passive=STRING|"0"
password=STRING|"4231738316406194034628830408604112640602242 423831112461"
port=STRING|"21"
username=STRING|"anonymous"

[Actions\Action3]
ActionID=STRING|"A_FTP_FILELOOP"
Enabled=INTEGER|-1
Name=STRING|"FTP File Loop"
Params=FOLDER

[Actions\Action3\Params]
filenameonly=STRING|"0"
folder=STRING|"/incoming/*.*"
kind=STRING|"0"
sizesave=STRING|"0"
subfolders=STRING|"0"
timesave=STRING|"1"
varname=STRING|"FTP_FILE"
vartime=STRING|"FTP_FILETIME"

[Actions\Action4]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action4\Params]
case=STRING|"0"
operator=STRING|"3"
type=STRING|"2"
value1=STRING|"{old_date}"
value2=STRING|"{FTP_filetime}"

[Actions\Action5]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action5\Params]
message=STRING|"File {ftp_file} is old ({ftp_filetime})"
type=STRING|"3"

[Actions\Action6]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action8]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""OLD_DATE"""
Params=FOLDER

[Actions\Action8\Params]
varname=STRING|"OLD_DATE"

[Actions\Action9]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FTP_FILE"""
Params=FOLDER

[Actions\Action9\Params]
varname=STRING|"FTP_FILE"

Last edited by Oleg on Fri Oct 19, 2007 5:03 am, edited 1 time in total.
Post Reply