Delete files older than a month

Discuss RoboTask here
Post Reply
david
Posts: 1
Joined: Tue Sep 20, 2005 10:06 pm

Delete files older than a month

Post by david »

I'm trying to set up the delete action to remove a certain file types
from a folder that are older than a month, and for it to run once a
week. The scheduling is working fine, but i'm having difficulty adding
the command /variable for the delete action to act on that criteria. i
am new to this program and would appreciate some assistance.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Delete files older than a month

Post by Oleg »

You may delete old files by using File Loop action. Adjust date filter so that the cycle select files older than 1 month. See example below.
Save text of task to file and use menu Task | Import to import into RoboTask.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task302"
Hide=INTEGER|0
ID=INTEGER|338083437
Name=STRING|"Delete old files (older than 1 month)"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action1\Params]
createmode=STRING|"4"
createormodified=STRING|"1"
date1=STRING|"20050921"
date2=STRING|"20050921"
destvar=STRING|"FILE_TO_DELETE"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\temp\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

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

[Actions\Action2\Params]
message=STRING|"Remove file {File_To_Delete}"
type=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action3\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{File_To_Delete}"
subdir=STRING|"0"
ToRecycleBin=STRING|"0"

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

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

[Actions\Action5\Params]
varname=STRING|"FILE_TO_DELETE"

Last edited by Oleg on Wed Sep 21, 2005 10:50 am, edited 1 time in total.
Post Reply