Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
ZAHIDHASEEB
New Contributor III

Send config file to sftp server via vdom root failed.

I am not able to run the backup command so that the fortinet backup can upload to a sftp server. Please note, I am able to ping and connect/login to sftp server successfully when I use winscp or other tool to connect with sftp server

 

200F-HA1 # execute backup config sftp FortinetBKP%date%.cfg 10.10.40.8:822 fortinet fortinet1
Please wait...
Connect to sftp server 10.10.40.8:822 ...
Please wait...
Connect to sftp server 10.10.40.8:822 ...
Send config file to sftp server via vdom root failed.
Command fail. Return code -1

7 REPLIES 7
sharmaj
Staff
Staff

Hello

 

This needs more investigation.

 

Please run this command: diag sniffer packet any " host 10.10.40.8 and port 822" for like 10 seconds while you try again and share the output

 

Jay sharma
ZAHIDHASEEB
New Contributor III

I replaced the ftp server internal name with external name and get successful result  . Below is the example command.

execute backup config sftp FortinetBKP-%%date%%.cfg sftp.domainname.com:822 fortinet fortinet1

 

However when I use the command with time, it gets failed

execute backup config sftp FortinetBKP-%%time%%.cfg sftp.domainname.com:822 fortinet fortinet1. Actually if we schedule backup on hourly basis then the same backup file gets overwrite. I don't want to overwrite the backup file instead make a new file

AlexC-FTNT

You can find some solutions discussed here:
https://community.fortinet.com/t5/Fortinet-Forum/Automated-config-backup-with-date/m-p/73003?m=19502...
https://community.fortinet.com/t5/Fortinet-Forum/Auto-script-override/td-p/67388

FortiGate is not responsible for storing/managing these configurations. You can use FortiManager for a more complete management solution.


- Toss a 'Like' to your fixxer, oh Valley of Plenty! and chose the solution, too00oo -
ZAHIDHASEEB

cant we use simply this ->  %%time%% like below command

execute backup config sftp FortinetBKP-%%time%%.cfg sftp.domainname.com:822 username password

AlexC-FTNT

Does the command work? (do you get the timestamp in the filename?)

yes > no problem

no > not implemented (or bug, if this feature was documented somewhere). 

All you can do is ask for NFR (new feature request through your local sales representative). But this has already been requested last year (NFR 684857) and not implemented (yet).


- Toss a 'Like' to your fixxer, oh Valley of Plenty! and chose the solution, too00oo -
ZAHIDHASEEB
New Contributor III

1- timestamp is not printing when I run the command from CLI (below result is for reference) and no backup generate when the script run from trigger

ZAHIDHASEEB_0-1647506645246.png

 

 

AlexC-FTNT

I know that %%date%% can be used, but I can't find any reference about %%time%% variable. Can you reference any document where this is presented as a "feature"?

The question is not about what works and not - it is about what is supposed to work and what not.


- Toss a 'Like' to your fixxer, oh Valley of Plenty! and chose the solution, too00oo -
Labels
Top Kudoed Authors