Solved

Unable to get atribute after using attr to set a attribute

Posted on 2013-05-09
4
331 Views
Last Modified: 2013-05-14
Following a perl file :
//mBackup
#!/usr/bin/perl
...
...
my $cmd1 = "attr -s svnVer -V 13716 $$archiveName"; #my command

my $result1 = execute_command($cmd1);

print LOG "svnVer set : $result1 on $$archiveName \n";
------

I do see that the $result1 is set as 0. But when i query the file using
attr -g svnVer $$archiveName, i get:

attr_get: No data available
Could not get "svnVer" for /es/ss.bkup.3.0.10May13_061459.tgz
0
Comment
Question by:pvinodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 39154929
my $cmd1 = "attr -s svnVer -V 13716 $$archiveName"; #my command
How did you assign a scalar reference to $archiveName?
Did you mean
my $cmd1 = 'attr -s svnVer -V 13716 $$archiveName';


my $result1 = execute_command($cmd1);
How did you declare sub execute_command?
0
 

Author Comment

by:pvinodp
ID: 39154978
Actually I copied the lines from already existing code..

    my $cmd = "cd $backup::tempDir; /bin/tar zcf $$archiveName $archives";
    my $result = execute_command($cmd);

#The above execution of command is successful. SO I used it to do my job. And all these 4 lines are consecutive lines. SO no access issues....

    my $cmd1 = "attr -s svnVer -V 13716 $$archiveName";
    my $result1 = execute_command($cmd1);




s
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 39154990
What is the already existing code that sets $archiveName?
What is the already existing code that declares sub  execute_command?
What do you get if you
  print $cmd1;
0
 

Author Closing Comment

by:pvinodp
ID: 39164477
thanks for your answers
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question