cancel
Showing results for 
Search instead for 
Did you mean: 

Nach Backup Dateien löschen?

sympanse
Level 3
Hallo,

Ich möchte nach einem erfolgreichen Backup Dateien in einem bestimmten Ordner löschen die älter als 2 Tage sind.
Ich weiß, daß es unter den 'Richtlinieneigenschaften' unter 'Erweitert' ein Feld gibt, wo man ein Batch-File triggern kann.
Hat jemand eine Batch-Vorlage für meinen Fall?
1 ACCEPTED SOLUTION

Accepted Solutions

Colin_Weaver
Moderator
Moderator
Employee Accredited Certified
To get Data onto tape you either specify that the target device is a tape device instead of the B2D device - or you create the job as a template in a policy to go to disk and then in the same policy you create a duplication template to duplicate the data from disk to the tape device.

View solution in original post

9 REPLIES 9

Colin_Weaver
Moderator
Moderator
Employee Accredited Certified
Sorry can't answer in German.

Bear in mind that the Run Post Command option in the properties of the job will start even if the job itself fails so you will probably have to look at using BEMCMD scheduled from Windows Taks Scheduler to identify that the job has finished successfully and then use the result to start whatever process might then identify the files you need to delete - this will almost certainly need a large amount of scripting outside of Backup Exec.

There is an easier way though

Create an Archive Job in Backup Exec instead of a standard backup job (Archive is an option in the Genaral tab/Backup Method section of the backup job) 
Also in the Selection list part of the job - click the Include and Exclude button and set the option to only include files not accessed in 2 days. This will only backup data not accessed in 2 days but because it is an archive job will delete the data once it has backed up.

Note: You should run a standard job without "the not accessed in 2 days include" as well as the archive job to backup the data that has been accessed in the last 2 days - your choice as to whether you run this job before or after the archive job - run it before and you will have 2 copies of the data on different media, run it after and you will save space on your media, but only have 1 copy.

I would recommend you restrict the main part of the archive job selection to the volume or folder structure containing your data as it you do this to the system drive of the server then something important that is only accessed during a boot might be removed. Then have a separate standard backup job to protect any files in other areas.

Would also recommend you test this before doing it with important data.

DominikG
Level 6
Partner Accredited
I would go with Colin's recommendation for an archive job. Therefore "thumb up"...

Sollte etwas nicht verständlich sein, kann ich auch anbieten es in Deutsch zu erläutern. ;)

best regards

Dominik

sympanse
Level 3

Hi Colin,

thanks a lot!
Helps to understand a few things.

To completely figure out how it works I need my test environment to 'mature' because of the access-option.

Nevertheless I'm curious about the 'include/exclude' settings. Seems that it doesn't keep it. After I changed and confirmed the setting it 'gets default' when I open the include/exclude menu again.
Is there anything wrong? Is there an overview to check that settings after confirmation?

Anyway I created a backup job (backup2disk) and let it run

  • one time without any include/exclude option

  • one time with the 2 days include option

  • one time with the 2 days exclude option

Always the same happened: it made a backup of the textfiles but never deleted anything. Always the same behaviour...

Best Regards
Michael

sympanse
Level 3
Danke für das Angebot, Dominik. Habe es verstanden, ob ich es auch inhaltlich verstanden habe ist eine andere Frage ;)

Colin_Weaver
Moderator
Moderator
Employee Accredited Certified
What you want to do is create a selection list to include everything that has not been accessed for two days and then in the General Settings section set the job to Archive. If you have only just created the files, the job will still report a success, but nothing will backup and somewhere in the job log it will say "This backup set may not contain any data". If the files are older than 2 days it should back them up and then delete them - with teh deletiogn section shoing up as a separate section in the job log - I have just tested this and seen it work.

One word of caution from my test - if the folder isetlf has not been accessed in 2 days - it will also be deleted - not just the files it contains.

If you want to review the settings of the selection list afterwards the GUI view will not show your two day rule. If you look at the text rule by clicking on the selections section and then clicking the View Selection Details tab you should see that the selection shows something like

C:\*.* /SUBDIR /ACCESSDAYS:02

The above is to backup everything not touched in 2 days on my C: drive including all subfolders

In practice you would probably have something more like
H:\HOME\*.* /SUBDIR /ACCESSDAYS:02
so that your job only deletes backed up files from the data area you need to manage in this way (and not from the whole server)



sympanse
Level 3

Hi Colin,

That's it - of course!
Saw the details view once but I forgot about it and couldn't connect it with the issue.

Details showed that there've been additional (common) rules, that's why everything was copied. After I cleaned it up the backup job worked properly as supposed to (nothing was copied).

I created some test-textfiles and so I will tomorrow. Next week I will have my test environment.
I will tell about the results.

Best Regards
Michael

sympanse
Level 3
Hi Colin,

the backup job's doing fine but how do I get it on tape? As "Mediensatz" (don't know the english term) "B2D" is defined like the other jobs.
To connect it with the existing rule seems to be the solution but it's impossible. That context option is disabled.

BR
Michael

Colin_Weaver
Moderator
Moderator
Employee Accredited Certified
To get Data onto tape you either specify that the target device is a tape device instead of the B2D device - or you create the job as a template in a policy to go to disk and then in the same policy you create a duplication template to duplicate the data from disk to the tape device.

sympanse
Level 3
It took some time but I started to 'go live' and it works.
Great!

Thanks a lot Colin for the great support.