-
RE: delete files older than
ok got that working now. all good. thanks for letting me sound off here.
<AMFILESYSTEM ACTIVITY="delete" AM_ONERROR="CONTINUE" SOURCE="%cfgPurgeFolder%/%cfgFileMask%" RESULTDATASET="dsResult" ISOLDERTHAN="%sysCutoffDate%" />
-
RE: delete files older than
ok i got the date calculation to work. just had to get the formula format right [and put Now() into a var rather than try it inline].
<AMVARIABLE NAME="cfgDaysOld" VALUE="21" />
<AMVARIABLE NAME="sysToday">%format(now(),"mm/dd/yyyy")%</AMVARIABLE>
<AMVARIABLE NAME="sysCutoffDate">%DateAdd("d",-cfgDaysOld,sysToday)%</AMVARIABLE>
now i have to see if i can use that in the file delete function
-
RE: delete files older than
for example these both fail...(var cfgDaysOld = 7)
<AMVARIABLE ACTIVITY="set" VARIABLENAME="sysCutoffDate">%DateAdd(d, -cfgDaysOld, Now())%</AMVARIABLE>
<AMVARIABLE ACTIVITY="set" VARIABLENAME="sysCutoffDate">%DateAdd(d, -%cfgDaysOld%, %Now()%)%</AMVARIABLE>
im not sure theres a way to use vars in the DateAdd function?
-
RE: delete files older than
very nice, thank you.
ideally, i would like to pass in the number of days as a parameter - in you example, the -7 is hardcoded - im uncertain if i can nest an additional set of %% inside the formula to extract the passed value. i am going to start with your code and see if i can layer that in... -
is there any way to search just within a specific forum?
update:
still no reply this so refreshing. im hoping that im just not knowing the proper way to do this. at this point for me, searching the forum for a specific automate topic is useless. please help...
whenever i try a search from the top menu, the search scope seems to be 'everywhere'. i just want to search within the Automate forums. is there a way to do that?
-
delete files older than
Hello forum users~
i want to be able to specify a number of days, filemask, folder and have a scheduled automate workflow delete obsolete files.
i can write most of this, but the thing im stuck on at the moment is how to pass in a number of days, and have the cut off date calculated. Then, ideally, i would like to massage that value into a form i can pass to the file/delete function and have them all done at once. but if that cant happen then i suppose i could step thru all the files and test/delete each one. im thinking this must be something that has been done by many, im just not sure where to look for info, hence this new thread. thank you all in advance...