Skip to main content

How can i schedule delete backup by command line on linux platform

Thread needs solution

I know how to schedule backup on centOS by command line, but how can i schedule delete backup which are over a week/month by command line ?

0 Users found this helpful

You can't create a scheduled backup plan from command line (you can only create a backup once). So scheduling retention rules is also impossible - you can only delete or consolidate backup using "delete backup" and "consolidate backup" commands.

I combine "crontab" to run scheduled backup. You can find the method from yours ABR11.5_cmdlineref_en-US.PDF(http://www.acronis.com/download/docs/abr11.5/cmdlineref) page115-116

Following is copy from ABR11.5_cmdlineref_en-US.PDF page115-116
------------------------------------------------------------------------------------------
4.10 Scheduling backups under Linux using the cron service
To automate backups, you can use the cron service familiar to many UNIX users.
Example
Let’s assume that you need to back up a volume regularly. A full backup has to be created weekly, supported by incremental backups created daily.
Use the list disks (p. 17) command to obtain the necessary volume number. For example, the volume number is 2-1.
Create two executable files for the daily and weekly backup (for example, abr.cron) and place them into the /etc/cron.daily and /etc/cron.weekly directories, respectively.
To initiate weekly full backups of volume 2-1, add the following line to the /etc/cron.weekly/abr.cron file: #!/bin/bash acrocmd backup disk --volume=2-1 --loc=/mnt/my_archives/my_host --arc=my_archive
where /mnt/my_archives/my_host is the path to the backup location.
The second abr.cron file is needed to initiate daily incremental backups. #!/bin/bash acrocmd backup disk --volume=2-1 --backuptype=incremental --loc=/mnt/my_archives/my_host --arc=my_archive
For more information, see Help of the cron service.
-----------------------------------------------------------------

So i want to know how to scheduled delete backup
or
how to use "acrocmd delete backup" command

I find some information form ABR11.5_cmdlineref_en-US.PDF(http://www.acronis.com/download/docs/abr11.5/cmdlineref) page110

Following is copy from ABR11.5_cmdlineref_en-US.PDF page110
---------------------------------------------------------------------------
Deleting backups (p. 44)
Deleting the specified backups from an archive. acrocmd delete backup --loc=C:\Backups --arc=my_archive --password=123 --backup=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX1,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX2
---------------------------------------------------------------------------

but i don't know what is "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX1,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX2", how can i find "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX1,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX2"

if i type acrocmd delete backup --loc=C:\Backups --arc=my_archive --password=123, this command line just delete the last backup archive

Hello rpg ghost,

Thank you for posting this question in our forum. I am happy to assist you.

You first should use the command list archives to retrieve the list of existing or found archives in the specified location. See the user guide for more information about.

Please see this example (from user guide):

acrocmd list archives --all --loc=bsp://storage_node1/my_vault --credentials="ASN user",pass123

To delete an archive, you can use this example (from user guide):

acrocmd delete archive --loc=bsp://storage_node1/my_vault --credentials="ASN user",pass123 --arc=my_archive

If you need additional assistance, please contact support. You will find all available support options in our Customer handbook.

If there is anything else we can do for you, please let me know.

Thank you.

Hello rpg ghost,
"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX1" stands for the ID of a backup that you want to delete. As you've correctly noticed, without this ID the command line just deletes the last backup. See the description of the --backup parameter: http://www.acronis.com/support/documentation/ABR11.5/index.html#12004.h… (the PDF document contains the same info).
You can obtain a backup ID by using the list backups command. http://www.acronis.com/support/documentation/ABR11.5/index.html#11637.h…
Defining a backup ID on a schedule (in order to delete this backup) may not be that simple. If you need to get rid of old backups, it's easier to use one of various retention rules available in GUI: http://www.acronis.com/support/documentation/ABR11.5/index.html#11675.h…