Automation to delete files

A
Alexis
Neopost

Hi community

I am looking to have a script that will run daily at 1am and delete files older than 90 days from a specific folder.

Filenames are set as below: XXXXXX_YYYYMMDDhhmmss_WWWWW.png

XXXXXX and WWWWW are constant names

YYYY is year

MM is month

DD is day

hh is hours

mm is minutes

ss is seconds

Is there a way to achieve the above ?

Thanks for your help

Alex

6 years ago
Android Scripting
ANSWERS
S
Scott
6 years ago

Need more information.  Deleting files on the server or device?  If server then a standard windows scheduled task is probably the easiest way to accomplish it.  If device then it depends on device type and MobiControl versions and you'll need to provide more specifics.

A
Alexis
6 years ago

Thank you for your reply Scott.

Files are to be deleted on Android+ devices.

Version of MobiControl is 13.3.0

Deleting the files is not really the challenge, the challenge is to grab and calculate the date during script execution. I would like to avoid to have to update the script every day with proper date. I have had difficulties to find out information about that.

JD
John Doe
6 years ago

When your devices are enrolled as Android Plus you may want to take a look at javascript script engine released with SOTI 15.0

C
Christophe
2 years ago

Hello all,

@john > could you tell me how you can delete for example the old file locate in a folder ?

For example, i have this  folder -> sdcard/pictures/ who contains some pictures 

I would like to delete some old file how i can do that ?

I can remove all files, but i would like to remove for exemple the image who are old than 10 days -> due to a problems into one of our apps.

thanks