trigger_fmg_backup
Start an asynchronous backup of FortiManager configuration to a remote FTP, SCP, SFTP, or TFTP server, then monitor the returned task ID until the file is written.
Instructions
Trigger a FortiManager system backup to a remote server.
Starts an asynchronous backup of the FortiManager's own configuration to an external FTP/SCP/SFTP/TFTP server. This is a FortiManager-itself operation -- it does not touch any managed device. Use wait_for_task() or get_task() (system_tools.py) to monitor completion; once done, the backup file is on the remote server at the given filename.
Args: service: Transfer protocol - "ftp", "scp", "sftp", or "tftp" server: Remote server hostname or IP address filename: Destination path and file name on the remote server (e.g. "tmp/fmg_backup.dat") username: Login username for the remote server (required for ftp/ scp/sftp; optional) userpasswd: Login password for the remote server (optional) port: Remote server port (optional; protocol default used if unset) passwd: Password to encrypt the backup file with (optional; FMG 7.0.11+/7.2.5+/7.4.2+ no longer allow an unencrypted backup)
Returns: dict: Backup result with keys: - status: "success" or "error" - task_id: Task ID for monitoring (if returned) - message: Status or error message
Example: >>> result = await trigger_fmg_backup( ... service="ftp", ... server="10.210.35.207", ... filename="tmp/fmg_backup.dat", ... username="tiger", ... userpasswd="fortinet", ... passwd="fortinet", ... ) >>> if result["status"] == "success": ... await wait_for_task(result["task_id"])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | ||
| passwd | No | ||
| server | Yes | ||
| service | Yes | ||
| filename | Yes | ||
| username | No | ||
| userpasswd | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||