Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


K Craig
2016-12-05T16:53:08Z
VisualCron 7.1.9
I'm trying to automate a cleanup of old backup files. I want to delete old folders AFTER the new folder has been created on the share.
For example:

I use a loop to determine which folders to create/delete.
Below would be an example of the first iteration through the loop.
These folders already exist on the share:
DBNAME_20161220_FULL
DBNAME_20161213_FULL
DBNAME_20161227_FULL is created.
Now I need to delete DBNAME_20161220_FULL and DBNAME_20161213_FULL.
I use the following RegEx to determine which Folder(s) to delete:

{REGEX(Replace|{LOOP(CurrentValueXLine)}|\d{8}|*)}
Which yields: DBNAME_*_FULL
I don't want to delete the NEW folder (DBNAME_20161227_FULL), so the folder {LOOP(CurrentValueXLine)} is checked as Use folder Exclusion.

Nothing is getting deleted and no error is generated..
Sponsor
Forum information
Support
2016-12-06T14:02:46Z
You cannot mix regex and wild cards. The regex must produce a file. It cannot produce a filename with a wild card.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Gary_W
2016-12-23T16:19:02Z
The regex of "DBNAME_\d{8}_FULL" is what you want to match (no need to replace anything), as long as you use the current loop value as an exclusion.
Scroll to Top