File Loop only finds "first" file

Discuss RoboTask here
Post Reply
Kirk
Posts: 5
Joined: Sat Sep 29, 2007 5:54 am

File Loop only finds "first" file

Post by Kirk »

I have a file loop that I modeled after Topic #263, which looks in a given directory for files older than one month.  However, it only seems to find the "first" file and ignore all the rest.  I was hoping that someone could tell me what I'm doing wrong.;**********************;* RoboTask Task file *;* Do not edit!       *;********************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|1401815705ContinueOnError=INTEGER|0ExternalName=STRING|"Task5"Hide=INTEGER|0ID=INTEGER|441579547Name=STRING|"FileLoopTest"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3[Actions]Action1=FOLDERAction2=FOLDERAction3=FOLDERAction4=FOLDERAction5=FOLDER[Actions\Action1]ActionID=STRING|"A_FLOW_IF"Enabled=INTEGER|-1Name=STRING|"If Then"Params=FOLDER[Actions\Action1\Params]case=STRING|"0"operator=STRING|"0"type=STRING|"3"value1=STRING|"{FolderExists({BACKUPDIR})}"[Actions\Action2]ActionID=STRING|"A_LOOP_FILE"Enabled=INTEGER|-1Name=STRING|"File Loop"Params=FOLDER[Actions\Action2\Params]createmode=STRING|"4"createormodified=STRING|"1"date1=STRING|"20080215"date2=STRING|"20080215"destvar=STRING|"BACKUPFILE"DuringDays=STRING|"1"DuringMonths=STRING|"1"file0=STRING|"{BACKUPDIR}\*.*"filecount=STRING|"1"OlderDays=STRING|"1"OlderMonths=STRING|"1"savesize=STRING|"0"searchkind=STRING|"0"subdirs=STRING|"1"timesize=STRING|"0"WithoutPath=STRING|"0"[Actions\Action3]ActionID=STRING|"A_ROBOTASK_LOG"Enabled=INTEGER|-1Name=STRING|"Log Message"Params=FOLDER[Actions\Action3\Params]message=STRING|"File '{BACKUPFILE}' deleted because it is over a month old"type=STRING|"0"[Actions\Action4]ActionID=STRING|"A_LOOP_END"Enabled=INTEGER|-1Name=STRING|"End Loop"[Actions\Action5]ActionID=STRING|"A_FLOW_ENDIF"Enabled=INTEGER|-1Name=STRING|"End If"The directory looks like this: Volume in drive C is CDrive Volume Serial Number is 1296-0409 Directory of C:\Backups12/16/2007  10:00 AM         &nbs p; 843,278 07-12-16-Pix.zip12/18/2007  10:06 PM         &nbs p; 332,268 07-12-18-Songs.zip12/18/2007  10:06 PM         &nbs p; 843,278 07-12-18-Pix.zip12/23/2007  10:02 AM         &nbs p; 332,268 07-12-23-Songs.zip12/23/2007  10:02 AM         &nbs p; 843,278 07-12-23-Pix.zip12/30/2007  10:00 AM         &nbs p; 332,268 07-12-30-Songs.zip12/30/2007  10:00 AM         1,012,723 07-12-30-Pix.zip01/06/2008  10:03 AM         &nbs p; 348,895 08-01-06-Songs.zip01/06/2008  10:03 AM         1,013,267 08-01-06-Pix.zip01/13/2008  10:03 AM         &nbs p; 348,688 08-01-13-Songs.zip01/13/2008  10:03 AM         1,013,267 08-01-13-Pix.zip01/20/2008  01:55 PM         &nbs p; 349,013 08-01-20-Songs.zip01/20/2008  01:55 PM         1,013,267 08-01-20-Pix.zip01/27/2008  10:04 AM         &nbs p; 348,653 08-01-27-Songs.zip01/27/2008  10:04 AM         1,013,267 08-01-27-Pix.zip02/03/2008  10:04 AM         &nbs p; 348,913 08-02-03-Songs.zip02/03/2008  10:05 AM         1,013,267 08-02-03-Pix.zip02/10/2008  10:05 AM         &nbs p; 348,913 08-02-10-Songs.zip02/10/2008  10:05 AM         1,013,538 08-02-10-Pix.zip02/15/2008  04:46 AM    <DIR>        & nbsp; ..02/15/2008  05:33 PM    <DIR>        & nbsp; .                19 File(s)     12,726,515 bytes                 3 Dir(s)  150,924,505,088 bytes freebut the log reads like this:I: 2/15/2008 5:15:25 PM: ****** Starting task... ******************I: 2/15/2008 5:15:25 PM: Task started with priority: NormalI: 2/15/2008 5:15:25 PM: Executing "If Then"I: 2/15/2008 5:15:25 PM: Executing "File Loop"I: 2/15/2008 5:15:25 PM: Executing "Log Message"I: 2/15/2008 5:15:25 PM: File 'C:\Backups\07-12-16-MyPix.zip' deleted because it is over a month oldI: 2/15/2008 5:15:25 PM: Executing "End Loop"I: 2/15/2008 5:15:25 PM: Executing "File Loop"I: 2/15/2008 5:15:25 PM: Executing "End If"I: 2/15/2008 5:15:25 PM: Task executed successfullyIf I manually move the oldest file out of the folder, then it will find the next file in the folder (in this case, 07-12-18-Songs.zip), but only that one.Thank you for your time!
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

File Loop only finds "first" file

Post by Oleg »

Each file has three time parameters:
Creation time - when file has been created
Modification time - when file has been modified
Last access time - when file has been opened

RoboTask uses only "modification time". But "dir" command may use another time.

Try to do the following:
Chane time filter in file loop to "All files"
and change log message to string
File '{BACKUPFILE}' has time {FileTime({BACKUPFILE})}
in order to get more information
Kirk
Posts: 5
Joined: Sat Sep 29, 2007 5:54 am

File Loop only finds "first" file

Post by Kirk »

Oleg,Thank you for responding.I changed the time filter to "All files" and changed the message to File '{BACKUPFILE}' deleted because it was last modified {FileTime({BACKUPFILE})}This is what my log looks like now:I: 2/16/2008 8:30:21 AM: ****** Starting task... ******************I: 2/16/2008 8:30:21 AM: Task started with priority: NormalI: 2/16/2008 8:30:21 AM: Executing "If Then"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\07-12-16-Pix.zip' deleted because it was last modified 12/16/2007 10:00:08 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\08-01-27-Songs.zip' deleted because it was last modified 1/27/2008 10:04:36 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\08-01-20-Pix.zip' deleted because it was last modified 1/20/2008 1:55:36 PMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\08-01-27-Pix.zip' deleted because it was last modified 1/27/2008 10:04:44 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\07-12-30-Pix.zip' deleted because it was last modified 12/30/2007 10:00:12 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\08-01-06-Pix.zip' deleted because it was last modified 1/6/2008 10:03:36 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:21 AM: Executing "File Loop"I: 2/16/2008 8:30:21 AM: Executing "Log Message"I: 2/16/2008 8:30:21 AM: File 'C:\Backups\08-01-13-Songs.zip' deleted because it was last modified 1/13/2008 10:03:50 AMI: 2/16/2008 8:30:21 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\07-12-18-Pix.zip' deleted because it was last modified 12/18/2007 10:06:10 PMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-02-03-Songs.zip' deleted because it was last modified 2/3/2008 10:04:56 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-02-10-Songs.zip' deleted because it was last modified 2/10/2008 10:05:16 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\07-12-16-Songs.zip' deleted because it was last modified 12/16/2007 10:00:02 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-01-06-Songs.zip' deleted because it was last modified 1/6/2008 10:03:30 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\07-12-23-Songs.zip' deleted because it was last modified 12/23/2007 10:02:50 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-02-03-Pix.zip' deleted because it was last modified 2/3/2008 10:05:02 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\07-12-18-Songs.zip' deleted because it was last modified 12/18/2007 10:06:02 PMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-01-20-Songs.zip' deleted because it was last modified 1/20/2008 1:55:28 PMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\08-02-10-Pix.zip' deleted because it was last modified 2/10/2008 10:05:22 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:22 AM: File 'C:\Backups\07-12-30-Songs.zip' deleted because it was last modified 12/30/2007 10:00:04 AMI: 2/16/2008 8:30:22 AM: Executing "End Loop"I: 2/16/2008 8:30:22 AM: Executing "File Loop"I: 2/16/2008 8:30:22 AM: Executing "Log Message"I: 2/16/2008 8:30:23 AM: File 'C:\Backups\08-01-13-Pix.zip' deleted because it was last modified 1/13/2008 10:03:56 AMI: 2/16/2008 8:30:23 AM: Executing "End Loop"I: 2/16/2008 8:30:23 AM: Executing "File Loop"I: 2/16/2008 8:30:23 AM: Executing "Log Message"I: 2/16/2008 8:30:23 AM: File 'C:\Backups\07-12-23-Pix.zip' deleted because it was last modified 12/23/2007 10:02:58 AMI: 2/16/2008 8:30:23 AM: Executing "End Loop"I: 2/16/2008 8:30:23 AM: Executing "File Loop"I: 2/16/2008 8:30:23 AM: Executing "End If"I: 2/16/2008 8:30:23 AM: Task executed successfullyHTH
Post Reply