Registered users
Linkedin Twitter Facebook Google+
  This website uses its own cookies or from third parties Close
33HOPS, IT Consultants
33HOPS ::: Proveedores de Soluciones Informáticas :: Madrid :+34 91 663 6085Avda. Castilla la Mancha, 95 - local posterior - 28700 S.S. de los Reyes - MADRID33HOPS, Sistemas de Informacion y Redes, S.L.Info

© XSIBackup: dynamically naming folders and resources

XSIBackup runs in the shell, it is a Bash script wich makes use of some binaries where more efficiency is required. The fact that it is a Bash script is not an accident, this allows customers to easily tweak XSIBACKUP-PRO to their needs and take advantage of some assets scripts have over compiled code, like being able to evaluate code.

It is a common problem among system administrators the need to name resources dynamically. Per instance, we might want to open a new XSITools repository every month and check the former, so that we can be sure our archived data is consistent and that a new repository is used as months pass. Or we might want to alternate backups in different repos, one per each day of the week. This way we would have one repository for Mondays, another one for Tuesdays, and so on. Casuistic is almost infinite, therefore we will try to cover some typical scenarios and leave the details to your particular needs.

© XSIBackup offers the --date-dir=yes option to generate timestamped folders, but you can use the power of the date function to create your own timestamps. Take on account that if you want to make use of the automatic deletion feature, you will need to use --date-dir=yes to make sure that the generated mask is exactly what XSIBackup looks for when deleting older folders to make room.

Open one XSITools repository per month

This is something like commented above and a very tipical need. To accomplish this we would only need to set a dinamic --backup-point argument:



The above code would just backup to the 201702-xsitools repository on February 2017 and to 201703-xsitools on march freeing us from the need to do it manually.

Backup to a different folder per day of the week

If what we want to achieve is what the title describes, then we just need to parse different arguments to the date function.



The above will generate folders like: Mon-xsitools, Tue-xsitools and so on.

Create a new Borg repository per month

To offer a different syntax, we can use the name abbreviation of the month in this case.



The above --backup-point argument will generate folders such as: Apr-Borg, May-Borg, Jun-Borg and so on at the remote server 192.168.3.232.

Some more advanced examples

We can also combine more complicated (not much) bash expressions to achieve further results.

Backup to a quarterly generated folder



Use two backup devices, one for even days and the other one for odd days



Backup to the even and odd days devices creating one new backup folder per quarter




XSITools and space provisioning

As you may already know, (c) XSIBackup is able to provision space should your datastore get full of backup data. Nevertheless, to avoid deleting things that you want to preserve, it will only delete folders that meet a predefined naming convention. The mask that is applied to backup folders is set in the conf/xsiopts file, and only that mask will be sought when locating folders to delete. In the above examples we have used folder names that do not follow this mask pattern, thus they will not be considered for deletion once the datastore fills up.

The reason not to do that is that (c) XSITools repositories may hold hundreds of VMs, so deleting them is not something that should be done automatically, unless you explicitly decide so. Depending on you backup folder's organization, you could be storing XSITools backups in weekly, monthly, alternate days folders, etc..., whatever is the type of structure you use, you may find it useful to give folders created with XSITools a name so that they will still be considered for automatic deletion. If that is your case, you could chose some automatic naming in the following fashion.



The above will generate a folder per month, storing XSITools data there, should the datastore fill up, it will be considered for automatic deletion. It's up to you to decide what's the period to use based on your datastore size and your needs.




Website Map
Consultancy
IT Manager
In Site
Resources & help
Index of Docs
33HOPS Forum

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


            Read our Privacy Policy