FortiDB-Specific Commands

This topic contains the information about CLI commands that perform FortiDB-specific tasks.

Note: For general CLI information, see the Basic CLI Information section of this document.
You can use the FortiDB CLI in order to perform the following tasks:
  • Export System Diagnostics: get diagnostic information about FortiDB and send it to an FTP server
  • Restart Application: shutdown and restart the FortiDB application server
  • Backup All-Settings: backup your local database, FortiDB system-configuration settings, archives and reports to an FTP server
  • Restore All-Settings: restore your local database, FortiDB system-configuration settings, archives and reports from a backup on an FTP server
  • Backup and Remove Archives: backup (to an FTP server) and remove archives (from the FortiDB appliance)
  • Restore Archives: restore archives from an FTP server
  • Backup and Remove Reports: backup (to an FTP server) and remove reports (from the FortiDB appliance)

If a command you entered fails,a return code is displayed:

Note: When you enter an incorrect information for the host name and that causes your system hung, please press <enter> to get back to the original prompt.

diagnose system export

This FortiDB CLI allows you to export diagnostic information to an FTP server.

Syntax:
diagnose system export fd_log <ftp server> <user> <password> [directory] [filename]

where:

Variable Description
<ftp server> IP address or hostname of FTP server.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
[directory] Location on FTP server where you want the diagnostic file to be placed.
[filename] Name of the zip file that contains several log files that will be put on the FTP server. If you don't specify a filename, you will get a default file called fortidb.zip.

Sample command:          

diagnose system export fd_log <your_ftp_server> <your_ftp_username> <your_ftp_password> . myDiagnose.zip

execute restart

This FortiDB CLI allows you to shutdown and restart the application server under which FortiDB is running.

Syntax:
execute restart appserver

execute backup all-settings

This FortiDB CLI allows you to backup your local database, FortiDB system-configuration settings, archives and reports.

Note: Please press <enter> to get back to the original prompt after the backup has completed with the message saying "Transfer Finished".
Syntax:
execute backup all-settings <ftp server> <filepath> <username> <password> [cryptpasswd]

where:

Variable Description
<ftp server> IP address or hostname of FTP server.
<filepath> Location on FTP server where you want the settings file to be placed.
Note: If you don't specify a name, you will get a default file called fdb_allbackup.dat.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
[crptpasswd] Optional password for protecting the settings file on the FTP server.

Sample command:        

execute backup all-settings <your_ftp_server> . <your_ftp_username> <your_ftp_password> myCrptpasswd

execute restore all-settings

This FortiDB CLI allows you to restore previously backed up your local database, FortiDB system-configuration settings, archives and reports.

Syntax:
execute restore all-settings <ftp server> <filepath> <username> <password> [crptpasswd]

where:

Variable Description
<ftp server> IP address or hostname of FTP server.
<filepath> Location of, and filename for, the settings file on the FTP server.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
[crptpasswd] Optional password for protecting the settings file on the FTP server.
Note: This operation will replace your current settings and necessitate a reboot.

Sample command:          

execute restore all-settings <your_ftp_server> ./fdb_allbackup.dat <your_ftp_username> <your_ftp_password> myCrptpasswd

execute restore fd-archive

This FortiDB CLI allows you to restore previously backed up your archives.

Syntax:
execute restore fd-archive <ftp server> <filepath> <username> <password>

where:

Variable Description
<ftp server> IP address or hostname of FTP server.
<filepath> Location of, and filename for, the settings file on the FTP server.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
Note: This operation will replace your current settings and necessitate a reboot.

Sample command:          

execute restore fd-archive <your_ftp_server> ./fdb_allbackup.dat <your_ftp_username> <your_ftp_password> 

execute backup-remove fd-archive

This FortiDB CLI allows you to backup and then remove your archives.

Syntax:
execute backup-remove fd-archive <before-date> <ftp server> <username> <password> [directory][filename]

where:

Variable Description
<before-date> Date of the last archive you want included in your backup. For example, if you specify 2008-12-31, the backup will include archives for up to this date. The format is YYYY-MM-DD (MM(1-12), DD(1-31)).
  • YYYY is a 4-digit number representing the year.
  • MM is a 2-digit number from 1 to 12 representing the month.
  • DD is a 2-digit number from 1 to 31 representing the day of the month.
<ftp server> IP address or hostname of FTP server.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
[directory] Location on FTP server where you want the tar file to be placed.
[filename] Name for the tar file on the FTP server where you want the archives to be placed. The default file name is FD-ARCHIVE-<before-date>.tar.

Sample command:          

execute backup-remove fd-archive 2008-07-30 <your_ftp_server> <your_ftp_username> <your_ftp_password> . myArchives.tar

execute restore fd-archive

This FortiDB CLI allows you to restore archives from an FTP server.

Syntax:
execute restore fd-archive <ftp server> <filepath> <username> <password>

where:

Variable Description
<ftp server> IP address or hostname of FTP server.
<filepath> Location on the FTP server of, and the filename for, your archive file.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
Note: This operation will replace your current archives if any.

Sample command:          

execute restore fd-archive <your_ftp_server> ./myArchives.tar <your_ftp_username> <your_ftp_password>

execute backup-remove fd-report

This FortiDB CLI allows you to backup and then remove your reports.

Syntax:
execute backup-remove fd-report <before-date> <ftp server> <username> <password> [directory][filename]

where:

Variable Description
<before-date> Date of the reports you want included in your backup. For example, if you specify 2008-12-31, the backup will include reports for up to this date. The format is YYYY-MM-DD (MM(1-12), DD(1-31)).
  • YYYY is a 4-digit number representing the year.
  • MM is a 2-digit number from 1 to 12 representing the month.
  • DD is a 2-digit number from 1 to 31 representing the day of the month.
<ftp server> IP address or hostname of FTP server.
<username> User name of account that logs on to the FTP server.
<password> Password of account that logs on to the FTP server.
[directory] Location on FTP server where you want the tar file to be placed.
[filename] Name for the tar file on the FTP server where you want the reports to be placed. The default file name is FD-REPORT-<before-date>.tar.

Sample command:          

execute backup-remove fd-report 2008-07-30 <your_ftp_server> <your_ftp_username> <your_ftp_password> . myReports.tar



FortiDB 5.0.0 Handbook
1st Edition , July 11 2013
© Copyright 2013 Fortinet Inc. All rights reserved.
Latest documentation: http://docs.fortinet.com/fdb.html