3. Junos software upgrade via FTP using wget
Mohsen Jamshidi
Core Network Engineer | Transitioning to System Administration | Exploring Opportunities in Firewalls, Linux, and Cloud
I have had some challenges when I wanted to copy Junos from ftp server directly to my Juniper router (ACX7100) when the ftp server asked me to provide username and password.
So I write here a useful and also simple command which could be used in FreeBSD (shell) in order to copy a file from ftp server to Juniper router.
wget -r -np -nd --user=[username] --password=[password] ftp://[FtpServer.address]/FirstFolder/SecondFolder/...../[DestinationFile] -P /var/tmp/
-r
????--recursive
??????Turn on recursive retrieving.??The default maximum depth is 5.
-nv
????--no-verbose
??????Turn off verbose without being completely quiet (use -q for that),
??? which means that error messages and basic information still get
??????printed.
-nd
????--no-directories
??????Do not create a hierarchy of directories when retrieving
??????recursively.?With this option turned on, all files will get saved
??????to the current directory, without clobbering (if a name shows up
??????more than once, the filenames will get extensions .n).
-P prefix
????--directory-prefix=prefix
??????Set directory prefix to prefix.?The directory prefix is the
??????directory where all other files and subdirectories will be saved
??????to, i.e. the top of the retrieval tree.?The default is . (the
??????current directory).