Registered users
Linkedin Twitter Google+
Close

In order to improve user's experience and to enable some functionalities by tracking the user accross the website, this website uses its own cookies and from third parties, like Google Analytics and other similar activity tracking software. Read the Privacy Policy
33HOPS, IT Consultants Download XSIBackup
33HOPS ::: Proveedores de Soluciones Informáticas :: Madrid :+34 91 930 98 66Avda. Castilla la Mancha, 95 - local posterior - 28700 S.S. de los Reyes - MADRID33HOPS, Sistemas de Informacion y Redes, S.L.Info
Thumb up icon This post applies to ©XSIBackup-DC, which is our newest technology

©XSIBackup-DC: pruning from Linux

Prunning scripts

We already discussed about the prunning process in our previous post Pruning Old Backups.

You should have some basic concepts clear so far: finding the blocks to prune is fast, actually deleting the blocks will take some time, the slower the FS is, the longer it will take to delete each block.

Thus, it seems clear, that deleting the blocks over NFS is not a good idea, as network latency times will have to be added on top of HD seek time. Then the best thing to do when pruning big repositories is to do it from the backup server itself, no matter if it's mounted over NFS or you are performing the backups over IP. Well, when pruning on over IP scenarios, the pruning is already made from the server side, thus this post will mainly apply to NFS mounted datastores.

Or being more straight: backups made over IP are conceptually superior to those made to mounted local NFS shares and they free you from the hassle to have to prune big repositories with a separate server side script.

In any case, for those of you still willing to do your backups to an NFS mount, you might need a way to prune your repos from the backup server OS context, instead as from the ©ESXi shell due to the above exposed reasons.

©XSIBackup-DC is a Linux binary, you can just use it as any other Linux binary. Then, the best way to prune backups would be to use find to collect the backup folders older than X days and then use the xsibackup binary to prune them via the --prune argument.

Below, the short one liner script that allows you to do so.



Explanation:

The find command is executed on the root of a repository. We use the -maxdepth 1 argument to select folders one level below (the backup folders).

We then use the -mtime +20 switch to select folders which are older than 20 days. We also want to make sure that we select only directories, hence the -type d (select directories).

Next arguments are relative to a regex filter that will allow us to select only the folders we want, namely: the ones that follow the timestamp rule of the backup folders YYYYDDMMhhmmss.

-regextype posix-egrep -regex "^/.*[0-9]{14}$"

As find returns absolute paths, we select strings starting by a slash (/) and ending in 14 numeric characters. Then the absolute paths are passed on to xsibackup --prune, where the {} \; represents each of the absolute paths.

Daniel J. García Fidalgo
33HOPS
This page was last modified on 2021-04-06



Website Map
Resources & help
33HOPS Forum
Index of Docs

©33HOPS site relies on the following technologies and partners:
SSL Protocol PayPal Payment Gateway Stripe Payment Gateway

©33HOPS Sistemas de Información y Redes, S.L. | VAT No: ESB83583716 | Avda. Castilla la Mancha, 95, local posterior, 28701 San Sebastián e los Reyes (Madrid) Spain



Fill in to download
The download link will be sent to your e-mail.
Name
Lastname
E-mail


            Read our Privacy Policy

(*) DC & Pro users, please login to your user area to download