Solved

Unable to get atribute after using attr to set a attribute

Posted on 2013-05-09
4
314 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

825 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