LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-15-2009, 01:28 AM   #1
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Rep: Reputation: 31
lvm snapshot using script


Hi,

I am writing a script to create backup of data on LVM. when i try to put variable in place of size number it stops, and put error on console.

Code:
[root@swd data]# lvcreate --size $sumM --snapshot -n backup /dev/vg_swd/LogVol02
  Invalid argument --snapshot
  Error during parsing of command line.
Code:
whereas same command works without any error. 
[root@swd data]# lvcreate --size 510M --snapshot -n backup /dev/vg_swd/LogVol02
 
Old 11-15-2009, 07:24 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The variable is $sum but the variable name given on the command is $sumM. Any of these will work
Code:
${sum}M
"${sum}M"
"$sum"M
$sum'M'
"$sum"'M'
The forms in which $sum (or $sum}) are in double quotes are more a little more robust in case $sum does not contain the expected integer but a value including whitespace such as space.
 
Old 11-15-2009, 08:35 AM   #3
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Original Poster
Rep: Reputation: 31
thanks, catkin. i will check this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux lvm snapshot Ammad Linux - General 4 11-11-2009 09:01 AM
lvm snapshot for backup eco Linux - Server 5 03-15-2009 07:27 AM
lvm snapshot Ammad Linux - General 1 02-18-2009 07:03 AM
LVM snapshot between different Groups Ammad Linux - General 3 01-04-2009 08:02 AM
About LVM Snapshot geethusari LinuxQuestions.org Member Intro 1 12-03-2007 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration