Solved

Unable to get atribute after using attr to set a attribute

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now