Backup Server - Cron Command

Introduction

FileCloud backup server is bundled with a command line utility (starting v12.0) that can be used for automation or in OS specific cron jobs. This section shows the various options supported by the cron utility command.

Running Cron Command

Cron command can be invoked as follows:

WindowsC:\xampp\htdocs\app\backupserver\> c:\xampp\php\php.exe backupcron.php
Linux$ cd /var/www/app/backupserver/
$ php backupcron.php 

Create New Backup Job

To create a new backup job, but not start it, use the following command:

Commandbackupcron.php --command=backup <--targetid=target_db_id | --targetname=target_name> --incremental=[0|1]
Parameters

--command=backup specifies that a new backup job is to be created <mandatory>

--targetid specifies the id of the target for which the backup job is to be created. This is the database id of target. <optional>

--targetname specifies the name of the target. This is the name assigned for the target during its creation in the UI <optional>

--incremental specifies whether the backup job is full or incremental. Use 0 for full or 1 for incremental. Default is 0. <optional>

Note: Though --targetid and --targetname is optional individually, one of these two should be present to uniquely identify the target.

Create And Start Backup Job

To create a new backup job and start it immediately, use the following command:

Commandbackupcron.php --command=backupnow <--targetid=target_db_id | --targetname=target_name> --incremental=[0|1]
Parameters

--command=backupnow specifies that a new backup job is to be created and started<mandatory>

--targetid specifies the id of the target for which the backup job is to be created. This is the database id of target. <optional>

--targetname specifies the name of the target. This is the name assigned for the target during its creation in the UI <optional>

--incremental specifies whether the backup job is full or incremental. Use 0 for full or 1 for incremental. Default is 0. <optional>

Note: Though --targetid and --targetname is optional individually, one of these two should be present to uniquely identify the target.

List Old Backup Jobs

To get a list of backup jobs, which were completed  x days or earlier, use the following command:

Commandbackupcron.php --command=listold <--targetid=target_db_id | --targetname=target_name> --daysold=x
Parameters

--command=listold specifies that a list of all the backup jobs completed x days and earlier should be returned<mandatory>

--targetid specifies the id of the target for which the backup job is to be created. This is the database id of target. <optional>

--targetname specifies the name of the target. This is the name assigned for the target during its creation in the UI <optional>

--daysold specifies the number of days or earlier for which the list should be generated. Default is 14. <optional>

Note: Though --targetid and --targetname is optional individually, one of these two should be present to uniquely identify the target.

Delete Old Backup Jobs

To delete a bunch of backup jobs, which were completed  x days or earlier, use the following command:

Commandbackupcron.php --command=deleteold<--targetid=target_db_id | --targetname=target_name> --daysold=x
Parameters

--command=listold specifies that a list of all the backup jobs completed x days and earlier should be returned<mandatory>

--targetid specifies the id of the target for which the backup job is to be created. This is the database id of target. <optional>

--targetname specifies the name of the target. This is the name assigned for the target during its creation in the UI <optional>

--daysold specifies the number of days or earlier for which the list should be generated. Default is 14. <optional>

Note: Though --targetid and --targetname is optional individually, one of these two should be present to uniquely identify the target.