cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Inbound Archive files

Former Member
0 Kudos

Hi MDM Guru's,

I want to delete files in the inbound archive folder of my repositoires. My MDM system runs on Unix, its not windows based.

How can i schedule a back ground task to delete these files, keeping the last week files only? Could it be done using clix, any Sql based commands or any........................

Please guide me.

Thanks in advance

Cheers

Srihari Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srihari,

I don't think this task can be possible using MDM CLIX or SQL commands.

As your requirement is to keep only those files that are not more than 7 days old; so this can be done using MS-DOS or VB Script.

After creating the script, you can schedule it according to your business requirement.

Please find the VB Script for it:

Dim oFSO, oFolder, oFiles, oFile, iDaysOld
iDaysOld=7
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("C:\TEST")
Set oFiles = oFolder.Files    
For each oFile in oFiles 
 If oFile.DateLastModified < (Date() - iDaysOld) Then 
  oFile.Delete(True) 
 End If 
Next

oFolder will contain the location of the files.

Regards,

Varun

Edited by: Varun Agarwal on Dec 4, 2008 4:21 PM

Former Member
0 Kudos

Hi Varun,

Thanks for the Update, will try to work out from my side.

Cheers

Srihari Reddy

Former Member
0 Kudos

Hi,

Yes you can delete the files present in Ready and Archive folder.

Follow the below steps:

1. Create a text file which contain the below lines:

cd {MDM Installation Path}\Server\......\Archive

del star . star /q

Note: Instead of writing "star" use star symol

E.g. C:\Program Files\SAP MDM 5.5 Server\Distributions\Test-MDM_MSQL\Test-Repo\Inbound\Remote_sys\Inbound_port\Archive

2. Save the file with .bat extension in C drive.

3. You can schedule this file using Windows Schedular. For this go to Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks and create a new one by double clicking on it. Select the bat file created and accordindly schedule it like daily, weekly etc.

4. Now whenever the task is due it automatically executes the commands written in bat file and deletes all the files from Archives folder.

Regards,

Jitesh Talreja

Former Member
0 Kudos

Hi Jitesh,

Thanks for the update. My request is i don't want to delete all the files in the archive directory, i want keep the files which are one week old in the archive directory.

Please guide

Cheers

Srihari Reddy

Former Member
0 Kudos

Hi Srihari,

for Unix I guess you should wrap something like this:

find . -type f -ctime +7 -exec rm -f {}\;

in a script file and use the Unix cron table to schedule a job.

Hope that helps.

Best regards

Christian

Edited by: Christian Heuer on Dec 4, 2008 1:21 PM

Former Member
0 Kudos

Hi Srihari,

Have you tried the script given in my last post. Is it not working?

Regards,

Varun

Former Member
0 Kudos

Hi Varun,

Don't have Visual Studio installed, so could not try the code. Need permission from our IT help desk guys.

Cheers

Srihari

Former Member
0 Kudos

Hi All,

Thanks for the update on the topic i had used Unix Command, its working fine.

Cheers

Srihari Reddy

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Check the below thread

Regards,

Jitesh Talreja

Former Member
0 Kudos

Hi Srihari,

We need to delete the files in the archieve folder manually.

At present we dont have any clix command or Gui based commands to delete these files.

Hope it helps.

Thanks,

Minaz