bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash question


From: jenea
Subject: Bash question
Date: Sun, 8 Mar 2009 15:56:30 -0700 (PDT)

This is my script:
=================================================================
#!/bin/bash
today_day=$(echo `date +"'%e %b %Y'"`)

echo $today_day

tar -cvz --newer $today_day -f /mnt/usb_backup/backup/diff/backupFull_`date
+%Y%m%d`.tgz /mnt/mirror80gb/Shared_Folder/



This is the debug:
=================================================================
filer:/mnt/usb_backup/backup/test# bash -x ./jenea
+++ date '+'\''%e %b %Y'\'''
++ echo ''\''25' Mar '2009'\'''
+ today_day=''\''25 Mar 2009'\'''
+ echo ''\''25' Mar '2009'\'''
'25 Mar 2009'
++ date +%Y%m%d
+ tar -cvz --newer ''\''25' Mar '2009'\''' -f
/mnt/usb_backup/backup/diff/backupFull_20090325.tgz
/mnt/mirror80gb/Shared_Folder/
tar: Failed to open '/dev/sa0': Operation not supported
filer:/mnt/usb_backup/backup/test# 


The problem is that the tar command would run only in the following syntax
(see date part):
=================================================================
tar -cvz --newer '22 Mar 2009' -f
/mnt/usb_backup/backup/diff/backupFull_`date +%Y%m%d`.tgz /mnt/mirror80gb/


My question is: How can i pass the variable's content into the tar line so
in the end it looks like this --- >  '22 Mar 2009' 


Thank you.
-- 
View this message in context: 
http://www.nabble.com/Bash-question-tp22404163p22404163.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]