Highlighted
iahsan
1 Copper

Archive files only without directory structure.

I am using Networker 7.6 to manually archive files only.

When I archive a file (nsrarchive), lets say 'file001' located in 'C:\archive' folder, the path to the file is also stored and therefore on retrieval if I retrieve ( using nsrretrieve) a file with -d (relocation) variable to lets say 'C:\restore' the outcome is the file 'file001' restored at 'C:\restore\C\archive' folder.

The procedures maintain and restore, directory structure as well.

I want to get rid of the directory structure both while archiving and retrieving, is that possible? if yes, how?

0 Kudos
6 Replies
ble1
5 Iridium

Re: Archive files only without directory structure.

I assume you use -S and therefore you relocate whole ssid which will always take into consideration original path.  If you user indexed archiving, you may wish to use browsable approach to get it back and then just as in case with restore this should be possible (not tested, but similar behavior applies to regular backup and restore).

iahsan
1 Copper

Re: Archive files only without directory structure.

Hi Hrvoje,

Thanks for your help.

What I understood from it is that I have to use the 'Indexed Archive' pool to restore files without directories. I did that, with partial success. Let me explain,

My usage scenario is that I have a command line utility that archives files from a folder. It uses the command,

"nsrarchive -qV -b "Indexed Archive" -s SERVERNAME -T ANNOTATION C:\FolderA\FolderB\File.dat"

and retrieves via,

"nsrretrieve -f -s SERVERNAME -d C:\retrieve\ -A ANNOTATION"

Now, using the command line even the 'Indexed Archive' pool results in file being restored to "C:\retrieve\C\FolderA\FolderB\File.dat"

However, if I archive from the 'NetWorker User' application UI and retrieve via the command line it gives the desired result i.e. restores file at "C:\retrieve\File.dat'.

Tells me I am missing some setting/some parameter/flag during the archiving process from command line, thanks for your help already and any more ideas will be much appreciated.

0 Kudos
ble1
5 Iridium

Re: Archive files only without directory structure.

I do not have server with archiving enabled to test it, but I can test it probably tomorrow on some test box.  Based on my experience with backup commands, it really depends on how and from where restore is called.  I will try to test it and get back here.

0 Kudos
iahsan
1 Copper

Re: Archive files only without directory structure.

Interestingly, there was a "-N" in the archive command which used the same value as ANNOTATION, the command ref guide says,

"N The symbolic name of this archive save set. By default, the first path argument is used as the name"

However, during hit and trial I found that when I remove this option the 'nsrretrieve' only restores the files to the relocated folder without any folders of the initial archiving path.

Any ideas how and why -N does this?

To summarise,

An archive stored/retrieved with these command ....
"nsrarchive -qV -b "Indexed Archive" -s networkerserver -T XYZ001 -N XYZ001 H:\Data\ziptest\test1\test.gz

"nsrretrieve -f -s networkerserver -d H:\relocate\ -A XYZ001"

always restores with the complete folder path using 'nsretrieve'.


Sample Command Line Output:

Requesting 1 recover session(s) from server.

H:\relocate\H\Data\ziptest\test1\test.gz

H:\relocate\H\Data\ziptest\test1\

H:\relocate\H\Data\ziptest\

H:\relocate\H\Data\

H:\relocate\H\

Recovering a subset of 6 files within / into H:\relocate

Received 5 matching file(s) from NSR server `networkerserver'

===================================================================


An archive stored/retrieved with these commands

"nsrarchive -qV -b "Indexed Archive" -s networkerserver -T XYZ001 H:\Data\ziptest\test1\test.gz"

"nsrretrieve -f -s networkerserver -d H:\relocate\ -A XYZ001"
only restores the file without any folders.


Sample Command Line Output:

Requesting 1 recover session(s) from server.

H:\relocate\test.gz

Recovering a subset of 6 files within H:\Data\ziptest\test1\ into H:\relocate

Received 1 matching file(s) from NSR server `networkerserver'

0 Kudos
ble1
5 Iridium

Re: Archive files only without directory structure.

-T is annotation.  -N is symbolic name of ssid (or path) and normally you would leave that alone and system would use path of ssid.  It might be if this is not found that whole thing is relocated.  Whether this is by design or not - I have no idea (I doubt it is, but then again archiving function has been made many many years ago and I have no idea about mindset back then).

0 Kudos
iahsan
1 Copper

Re: Archive files only without directory structure.

Thanks a lot for your help Hrvoje,

Well removing the -N option resolves the problem, the rest was just out of curiosity to find out what goes behind "-N".

Regards,

Ahsan

0 Kudos