06-24-2022 07:29 AM
Hi Everyone,
I'm having a problem when using FTP to backup my devices' config files, the problem is that I can't copy the config file to a certain directory within the FTP server, for example the following command won't work:
#copy nvram:startup-config ftp://x.x.x.x/dir1/dir2/dir3/"Config-File"
It will only accept the command in the following form:
#copy nvram:startup-config ftp://x.x.x.x
the problem is that the above command won't save the file to the directory that I want, it will save it in the main directory.
Please note that I know if use the command (#copy nvram:startup-config ftp://x.x.x.x) and press enter, I can then specify the desired directory, but that won't help me because I won't to use kron to send the backup every day in all of my devices.
Also note that I've tried it on different devices and different IOS images and I got the same Result.
Thank You
06-24-2022 07:37 AM
Is that FTP have username and password ? or open for any one to upload Files.
If you like copy the file to below folder - dir1/dir2/dir3/"Config-File"
user should have rights to write permission to write the file
or change the Root folder of FTP to dir1/dir2/dir3/"Config-File"
by the way what FTP Server, what you see the logs when the cisco router try to copy to folder -dir1/dir2/dir3/"Config-File"
06-24-2022 08:15 AM
I have configured the FTP server with username and password using the commands (ip ftp username & ip ftp password).
When I try to copy the config file to the FTP server a log message will show up saying (permission denied) even though I made sure that the user has write permission (I also used it with FileZilla and I can write with it).
As an Example:
#copy nvram:startup-config ftp://192.168.165.46/home/HalaNOC/Cores/TEST
Address or name of remote host [192.168.165.46]?
Destination filename [home/HalaNOC/Cores/TEST]?
Writing home/HalaNOC/Cores/TEST
%Error opening ftp://192.168.165.46/home/HalaNOC/Cores/TEST (Permission denied)
(The device won't accept that above command because it's a "permission denied), but if I did it as bellow:
#copy nvram:startup-config ftp://192.168.165.46
Address or name of remote host [192.168.165.46]?
Destination filename [sw1]? /home/HalaNOC/Cores/TEST
Writing /home/HalaNOC/Cores/TEST !
7726 bytes copied in 0.052 secs (148577 bytes/sec)
(The device will accept it even though it's the same username and password)
06-24-2022 09:00 AM
- Check your ftp server's logs too , or use debugging mode . if supported. Then compare successful attempt versus failed attempt , in the ftp-server's logs
M.
06-24-2022 09:17 AM - edited 06-24-2022 09:18 AM
home/HalaNOC/Cores/TEST
the user need to have rights all the way in the path, not just the folder
for each testing - make user home directory home/HalaNOC/Cores/TEST ( give all permission and test it)
by the way what FTP Server is this ?
06-24-2022 07:39 AM
Hi
Seems to me as a permission problem. Do you have permission to write on those directories ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide