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

FAQ
It is currently Sat Aug 19, 2017 2:42 am


Author Message
mandrei99
Post  Post subject: Archiving files in Juniper SRX devices  |  Posted: Fri Jul 12, 2013 9:40 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Archiving files in Juniper SRX devices

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).





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Archiving files in Juniper SRX devices"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Juniper - Junos 11.4R8 based Olive

mandrei99

1

2677

Tue Jun 18, 2013 5:36 am

mandrei99 View the latest post

There are no new unread posts for this topic. Juniper SRX / Junos rescue configuration is not set

mandrei99

0

3349

Mon Feb 16, 2015 11:42 am

mandrei99 View the latest post

There are no new unread posts for this topic. Junos: How to disconnect idle ssh connections in configuration mode - Juniper SRX

mandrei99

0

18645

Tue May 14, 2013 5:40 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News 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