Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Wed Jul 17, 2019 10:59 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - Archiving files in Juniper SRX devices
Author Message
Post subject: Archiving files in Juniper SRX devices  |  Post Posted: Fri Jul 12, 2013 9:40 am
The operational "> file archive" Junos command will archive files and compress them optionally.

Although the output of following command shows the current working directory for the user:
Code:
user@srx-220> file archive compress source ?
Possible completions:
  <source>             Path of directory to archive
  COS-config.conf      Size: 151632, Last changed: Apr 16 15:30:14


The actual command does not use the same directory. Example:
Code:
user@srx-220> file archive compress source COS-config.conf destination COS-config.conf.tgz
/usr/bin/tar: COS-config.conf: Cannot stat: No such file or directory
/usr/bin/tar: Error exit delayed from previous errors

user@srx-220> file archive compress source COS-config.conf destination COS-config.conf.tgz | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.1X44/junos">
    <output>
        /usr/bin/tar: COS-config.conf: Cannot stat: No such file or directory
        /usr/bin/tar: Error exit delayed from previous errors
    </output>
    <rpc>
        <file>
            <file-fetch>
                <source-filename>/var/tmp//COS-config.conf.tgz3sFg</source-filename>
            </file-fetch>
        </file>
    </rpc>
    <rpc>
        <file>
            <file-put>
                <source-filename>/var/tmp//COS-config.conf.tgz3sFg</source-filename>
                <destination-filename>COS-config.conf.tgz</destination-filename>
            </file-put>
        </file>
    </rpc>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>


So the actual directory by the "file archive" command to find the source file is "/var/tmp/".

Instead, use absolute paths to the source and destination files:
Code:
user@srx-220> file archive compress source /cf/var/home/user/COS-config.conf destination /cf/var/home/user/COS-config.conf.tgz
/usr/bin/tar: Removing leading `/' from member names


I will open a PR with Juniper engineering soon (can't commit on a date).
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO