Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to script browse or retention time with save command

Status
Not open for further replies.

jciarlette

Technical User
Aug 27, 2002
60
US
When I try to script the browse or retention time using the save command, I am unable to use "1 year" type of time date.
The command I am setting a variable to is:

/usr/bin/save -s legatos -c aixsn1.edward.org -b dd860n -w 9/28/2015 -y 9/28/2015

Here is the whole script:

set -x
backup='/usr/bin/save -s legatos -c aixsn1.edward.org -b dd860n -w "1 year" -y "1 year"'
echo $backup
$backup /home/jciarlet/

What I get back is:

6893:save: invalid browse time: "1

For some reason "1 year" is not getting passed correctly to the save command.

When I use mm/dd/year format it works without issue.

What is going on?


 
The issue is that the period specified by the relative policies must be converted to an absolute timestamp in the NW media index.
The "save" manpage explains this pretty clear.

 
I am having a difficult time finding the manpage for "save". My system is saying Manual entry for save not found or not installed. Can you clarify that the period specified must be converted? Are you saying I need convert it or the save command should convert the period but it has to be a valid period. I read the nsr_getdate format requirements and they say "Year" is a valid unit to use.
 

Maybe the appropriate package (lgtoman) is not installed.


From the NW 8.1 Command Line Reference, "save" command

– e expiration
Set the date (in nsr_getdate(3) format) when the saved data will expire. When a save set has an explicit expiration date, the save set remains both browsable
and non-recyclable until it expires. Thus, the explicitly provided expiration overrides the existing browse and retention times specified in the client policy
and the browse and retention times get changed to the newly specified time. The "-e exp_time" option cannot be used in conjunction with "-w browse_time"
or "-y reten_time". By default, no explicit expiration date is used and the client’s longest browse and longest retention policy are used.

–w browse_time
Sets the date (in nsr_getdate(3) format) after which this save set will no longer be browsable. By default, the server determines the browse date for the save
set based on the browse policies in effect. This option allows overriding the existing policies on a save by save basis.
 
This line here is all I needed to see:
"By default, no explicit expiration date is used and the client’s longest browse and longest retention policy are used."

I made sure the clients browse and retention was set for 1 year.
Tested, and this worked perfect. No need for me to script the date a year for the save command.

Thank you for helping out with this.
 
Hello,

date/time under Networker can be relative (+2 months, -5 days...).

If you don't give an absolute date/time to the command (like "09/28/2015 09:55:12"), you must prefix by a plus or minus sign.

So, if you want to plan an expiration date of 2 years beginning at the date of the save just issue -e "+2 years", and so on (always enquoted, or not ;-)).

Hope this helps.

Denis

PS : you can also use this syntax in all Networker commands that use date/time fields, like mminfo...

e.g :
mminfo -avot -q "savetime>'-1 week'" -r "client,name,savetime"
ouputs saves for the last 7 days...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top