It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda CloudGen Firewall

This Firmware Version Is End-Of-Support

Documentation for this product is no longer updated. Please see End-of-Support for CloudGen Firewall Firmware for further information on our EoS policy.

phionrcscleanup

  • Last updated on

To maintain the Revision Control System (RCS) directory, use the phionrcscleanup utility to delete versions that are older than a specified number of days, months, or years. You can also delete versions that are older than a specified date. The versions are deleted from the RCS file header, and the file body is truncated at the same position. Any database files that have accidentally been added to RCS are also erased from the specified directory.

Before using the phionrcscleanup utility on the Barracuda Firewall Control Center, Barracuda Networks recommends that you block the rangeconf service in order to avoid serious damage to the files within the RCS directories. For high availability (HA) Control Centers, you must block the boxconfig service and run phionrcscleanup on both HA units.

Options

List of all phionrcscleanup options.

phionrcscleanup version 1.0
Copyright (c) 2008 Barracuda Networks Inc. All rights reserved.
To start the program, please use the following options:
   phionrcscleanup --path=<file_path | dir_path> < 1 | 2 | 3 | 4 >| --verbose | --no-check
   where:
   1 := --date=< date yyyy.mm.dd>,
   2 := --days=< days_number >,
   3 := --months=< months_number >,
   4 := --years= < years_number >.

The following table lists descriptions of the options that you can use with phionrcscleanup:

Option Description
--path= Specifies a path to either a file or a directory to scan for RCS files.
--date=  Specifies a date from which all older versions will be deleted.
--days=

Specifies the maximum number of days that versions can be kept before being deleted.

--months= Specifies the maximum number of months that versions can be kept before being deleted.
--years= Specifies the maximum number of years that versions can be kept before being deleted.
--verbose Writes status information to the command line.
--no-check Disables integrity checks of file contents before files are saved to disk.

On standalone firewall instances, files under the path /opt/phion/config/Singleversion/S1/NGFW/RCS must be moved manually. phionrcscleanup does not work within his directory.

Setting Up a Cronjob

Example 1 

To set up a cronjob for phionrcscleanup using Barracuda Firewall Admin, log into the Box Layer of the Barracuda Firewall Control Center and open the System Scheduler page. In the cronjob configuration, enter phionrcscleanup in the Command table. For example, you can enter:

phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --months=6

For more information on setting up cronjobs, see Cronjobs.

Example 2

To set up a cronjob using the command line:

* * * * * command to be executed
- - - - |
| | | |
|
| | | ----- Day of week (0 - 7) (Sunday=0 or 7)
|
| | ------- Month (1 - 12)
|
| --------- Day of month (1 - 31)
|
----------- Hour (0 - 23)
-------------
Minute (0 - 59)

Example for a Control Center

crontab -e
* * 1 * * phionctrl module block rangeconf;  /opt/phion/bin/phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --months=1; phionctrl module start rangeconf; 

Example for an HA Control Center

crontab -e
* * 1 * * phionctrl module block rangeconf;  /opt * * 1 * * phionctrl box block boxconfig; phionctrl module block rangeconf; 
/opt/phion/bin/phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --months=1; phionctrl module start rangeconf;
phionctrl box start boxconfig;
Example 3

To start a cronjob on a daily, hourly, weekly, or monthly interval, place a script in one of the directories at /etc/cron:

Example Script for a Control Center

#!/bin/bash
phionctrl module block rangeconf;
/opt/phion/bin/phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --days=10;
phionctrl module start rangeconf;

 Example Script for an HA Control Center

#!/bin/bash
phionctrl box block boxconfig;
phionctrl module block rangeconf;
/opt/phion/bin/phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --days=10;
phionctrl module start rangeconf;
phionctrl box start boxconfig;

Example Usage and Output

phionrcscleanup --path=/opt/phion/rangetree/configroot/Revision --days=30 --verbose
phionrcscleanup version 1.0
Copyright (c) 2008 Barracuda. All rights reserved. 
Processing file: opt/phion/rangetree/configroot/Revision/0/RCS/range.conf,v
Opening file for reading...             OK
Retrieving information from file...     Ok
Parsing file...                         OK
Checking file integrity...              OK
Save file to disk...                    OK 
Processing file: opt/phion/rangetree/configroot/Revision/0settings/RCS/fwobj.fwobj,v
Opening file for reading...             OK
Retrieving information from file...     Ok
Parsing file...                         OK
Checking file integrity...              OK
Save file to disk...                    OK
...
Finished Successfully