Rotate Backups

I'm using a RHEL7 box as an FTP server for NSX backups for two managers.  One is on 6.4.4 and the other is 6.4.6.  What's the best approach to rotating out backups?  Right now I'm doing it the old fashioned way of periodically checking disk space on the RHEL box.  Would logrotate get this done or is there a better approach?  The problem with my method is if I get busy and don't  check on it the next thing  I know backups are failing because the partition filled up. 

Also, what  is best practice for the frequency of backups?  We're doing daily which seems a little excessive to me.

Thanks for any wisdom you can impart!

0 Kudos
2 Replies

Hello cowhowUTA​,

As i worked with backup many times i would recommend always having at least one daily copy even if you are not doing changes inside the product you have everything in sync with the external solutions such as vCenter, vROPs and whatever you are integrating with.

For the rotation unluckily there is no mechanism inside NSX so you can use a very simple script to check the files and at least have 15 or 30 days of files to revert.

For the script to be run you should use a cron task inside the manager to run everyday.

0 Kudos

Hi Tony,

Make sure the backup directory only have up to 100 files as per the NSX Admin guide here: Back Up NSX Manager Data

Files in the Backup Directory must be limited to 100. If the number of files in the directory exceeds this limit, a warning message is displayed.

Depending on your backup schedule (hourly/daily/weekly) you may need to limit that.

Let say you're doing nightly backup, to a folder /nsxbackup, then you can create a housekeeping script which runs daily and move or archive anything older than 60 days for example.

Or if you need to store files up to 180 days, the script can move to a different/archive folder (e.g. /nsxarchive) in case you need to restore to older days.

But all of this is managed outside of NSX which will be on your RHEL7 box

Sample of command to delete files older than a particular time here:

Bayu Wibowo | VCIX6-DCV/NV
Author of VMware NSX Cookbook | twitter @bayupw
0 Kudos