The following example illustrates how to create archive files from a box for backup purposes at regular intervals. For this task, the executing script calls a tool named phionar
which is located under the path /opt/phion/bin/
. Phionar takes the contents of the directory /opt/phion/config/configroot
as a template for creating the backup archive file. For creating a complete, unencrypted archive with the name box_[Year-Month-Day-Hour-Minute].par
in the directory /usr/local/bin/backups
, this information must be organized into an executable script file. It is recommended to store the script into a directory that is located outside of directories handled by the system, i.e., /usr/local/bin/userscripts
.
Step 1. Create a Directory for Your Scripts and Your Backups on Your Firewall
- Log into your firewall on box level.
- Go to SSH and log into your firewall as user 'root'.
- If not already present, create the directory for your backup files, i.e.,
/usr/local/bin/backups
- If not already present, create the directory for your script, i.e.,
/usr/local/bin/userscripts
- Change to the newly created script directory.
Step 2. Create an Executable Script with the Name boxpar_creator.sh
, Save It in the Directory /usr/local/bin/userscripts
and Make It Executable:
Create the script in your preferred editor.
- Save the script in the directory
/usr/local/bin/userscripts
with the nameboxpar_creator.sh
- Make the script executable with the command
chmod ugo+x boxpar_creator.sh
Step 3. Configure a Cronjob that Executes the Script Every Second Hour
- Go to Box > Advanced Configuration > System Scheduler.
- In the left menu, click Daily Schedule.
- Click Lock.
- In the Intraday Schedule section, click +.
- Enter the name for your intraday schedule, i.e.,
BoxPar creator
- Click OK. The Intraday Schedule window opens.
- Enter the Description for your schedule to be
BoxPar creator every 2nd hour
- Click the green +.
- Enter the full path name, including the name of the script.
- From the Hourly Schedule list, select every.
- For Run Every .. Hours, enter
2
. - Click OK.
- Click Send Changes.
- Click Activate.
Verify that the par files have been created under the path /usr/local/bin/backups
Step 4. Unschedule Experimental Cronjob and Remove Unneeded Script and Backup Files
After your have successfully created a script executed via a scheduled cronjob at regular intervals, it is recommended to unschedule the cronjob and to delete all previously created experimental files.
- Go to Box > Advanced Configuration > System Scheduler.
- In the left menu, click Daily Schedule.
- Click Lock.
- In the Intraday Schedule table, select your entry for your daily schedule and click x to delete it.
- Click Send Changes.
- Click Activate.
- Go to SSH and log into your firewall as user 'root'.
Delete the previous created directories (userscripts, backups) with the contained scripts and backup files.