LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Regular backup by date. Please correct me the command (http://www.linuxquestions.org/questions/linux-server-73/regular-backup-by-date-please-correct-me-the-command-933682/)

Bullz3y3 03-09-2012 11:18 PM

Regular backup by date. Please correct me the command
 
I've created a script for backup up my Zimbra folder according to this
Code:

http://www.youtube.com/watch?v=xhUksAhpBxw&feature=related
But exact command doesn't seem to work on ubuntu. here's the script

Code:

!/bin/bash
service zimbra stop

cp -rp /opt/zimbra /zimbkp/'date+%d%m%Y'/

service zimbra start

The copied folder will names as "date+%d%m%Y" not the date I require. Please help :scratch:

macemoneta 03-09-2012 11:42 PM

You need to use accent quotes to execute a command (date), you missed a space between the command and its parameters, and you should single quote the parameters:
Code:

cp -rp /opt/zimbra /zimbkp/`date '+%d%m%Y'`/

David the H. 03-10-2012 08:03 AM

In addition to the above, $(..) is highly recommended over `..` for embedded commands.

You might also want to consider using the -t option in cp and mv instead, to explicitly define the target directory. At least in scripts.

Code:

cp -rp -t "/zimbkp/$( date '+%d%m%Y' )/" "/opt/zimbra"

moltimia.1111 03-10-2012 11:33 AM

hi friends , how are you ?
i am very very new to linux .
in wily LPIC1 study Guide book-at page 51 , it reads :
#rpm -uvh samba-server-3.0.25b-4.5mdv2008.0.x86_64.rpm
but i don't know what?can someone help me please ?

macemoneta 03-10-2012 12:23 PM

Quote:

Originally Posted by moltimia.1111 (Post 4623486)
hi friends , how are you ?
i am very very new to linux .
in wily LPIC1 study Guide book-at page 51 , it reads :
#rpm -uvh samba-server-3.0.25b-4.5mdv2008.0.x86_64.rpm
but i don't know what?can someone help me please ?

Please start a new thread for unrelated questions.


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