INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Unable to script browse or retention time with save command

Unable to script browse or retention time with save command

(OP)
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?


RE: Unable to script browse or retention time with save command

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.

RE: Unable to script browse or retention time with save command

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

RE: Unable to script browse or retention time with save command


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.

RE: Unable to script browse or retention time with save command

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

RE: Unable to script browse or retention time with save command

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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close