LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-09-2012, 11:18 PM   #1
Bullz3y3
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
Unhappy 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
 
Old 03-09-2012, 11:42 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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'`/
 
Old 03-10-2012, 08:03 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
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"
 
Old 03-10-2012, 11:33 AM   #4
moltimia.1111
LQ Newbie
 
Registered: Mar 2012
Posts: 15

Rep: Reputation: Disabled
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 ?
 
Old 03-10-2012, 12:23 PM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Quote:
Originally Posted by moltimia.1111 View Post
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.
 
  


Reply

Tags
backup, date, zimbra


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] backup command: 'dump' and 'pax' => correct syntax usage dragonetti Linux - Newbie 3 10-10-2011 03:17 AM
SWATCH::not able to get the correct match count when i use regular expression vjayraghavan Linux - Newbie 0 03-27-2009 02:16 AM
Command line: How do I backup files modified after a specific date only rm_-rf_windows Linux - General 2 06-28-2007 09:34 PM
what is the correct syntax order for tar with --after-date DATE, --newer DAT farhan Linux - General 1 03-16-2007 09:43 AM
time and date not correct, after reboot vasanthraghavan Linux - General 4 03-10-2005 12:55 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration