<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How To Back Up a Web Server</title> <atom:link href="http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-67611</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Thu, 26 Jan 2012 18:40:54 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-67611</guid> <description>Setup ssh keys as described in step #2.</description> <content:encoded><![CDATA[<p>Setup ssh keys as described in step #2.</p> ]]></content:encoded> </item> <item><title>By: Lo</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-67606</link> <dc:creator>Lo</dc:creator> <pubDate>Thu, 26 Jan 2012 14:35:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-67606</guid> <description>Hey Vivec,
this is an excellent script. on Redhat, it is asking me for a password. how can i deal with that.</description> <content:encoded><![CDATA[<p>Hey Vivec,</p><p>this is an excellent script. on Redhat, it is asking me for a password. how can i deal with that.</p> ]]></content:encoded> </item> <item><title>By: Leon</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-63643</link> <dc:creator>Leon</dc:creator> <pubDate>Tue, 18 Oct 2011 10:16:35 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-63643</guid> <description>Excellent script, thanks for sharing.</description> <content:encoded><![CDATA[<p>Excellent script, thanks for sharing.</p> ]]></content:encoded> </item> <item><title>By: dhanesh mane</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-54974</link> <dc:creator>dhanesh mane</dc:creator> <pubDate>Wed, 19 Jan 2011 05:05:37 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-54974</guid> <description>perfect script. I was looking for something like this only and found the correct script works perfect on ubuntu.</description> <content:encoded><![CDATA[<p>perfect script. I was looking for something like this only and found the correct script works perfect on ubuntu.</p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-46243</link> <dc:creator>Chris</dc:creator> <pubDate>Wed, 03 Mar 2010 21:52:54 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-46243</guid> <description>Spectacular script. I don&#039;t suppose you have a version that also restores? :)</description> <content:encoded><![CDATA[<p>Spectacular script. I don&#8217;t suppose you have a version that also restores? :)</p> ]]></content:encoded> </item> <item><title>By: Casey</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-43930</link> <dc:creator>Casey</dc:creator> <pubDate>Fri, 02 Oct 2009 16:35:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-43930</guid> <description>Hi Vivek,
I believe it is the == that is not working.  Obviously this should mean equal to but for some reason I just get an error.  I have read around and people have stated to use the -eq instead of the == but this is only for numbers and I have tried this.
The statement below is what I have added for testing purposes.  I have put the result at the bottom.  I am completely baffled!
ead #This is to cause an error in the script
if [ &quot;$?&quot; -eq &quot;0&quot; ]; then
echo &quot;This is good before $?&quot;
else
echo &quot;This is bad before $?&quot;
fi
### Find out if ftp backup failed or not ###
if [ &quot;$?&quot; -eq &quot;0&quot; ]; then
rm -f $BACKUP/*
echo &quot;All Good $?&quot;
else
T=/tmp/backup.fail
echo &quot;Date: $(date)&quot;&gt;$T
echo &quot;Hostname: $(hostname)&quot; &gt;&gt;$T
echo &quot;Backup failed&quot; &gt;&gt;$T
sendmail &quot;BACKUP FAILED&quot; &quot;$EMAILID&quot; &lt;$T
rm -f $T
echo &quot;ALL Bad $?&quot;
fi
if [ &quot;$?&quot; -eq &quot;0&quot; ]; then
echo &quot;This is good after $?&quot;
else
echo &quot;This is bad after $?&quot;
fi
Result from this is:
test.sh: 42: ead: not found
This is bad before 1
All Good 0
This is good after 0
I am completely stumped.  Any ideas?  Thanks
Casey</description> <content:encoded><![CDATA[<p>Hi Vivek,</p><p>I believe it is the == that is not working.  Obviously this should mean equal to but for some reason I just get an error.  I have read around and people have stated to use the -eq instead of the == but this is only for numbers and I have tried this.</p><p>The statement below is what I have added for testing purposes.  I have put the result at the bottom.  I am completely baffled!</p><p>ead #This is to cause an error in the script</p><p>if [ "$?" -eq "0" ]; then<br
/> echo &#8220;This is good before $?&#8221;<br
/> else<br
/> echo &#8220;This is bad before $?&#8221;<br
/> fi</p><p>### Find out if ftp backup failed or not ###<br
/> if [ "$?" -eq "0" ]; then<br
/> rm -f $BACKUP/*<br
/> echo &#8220;All Good $?&#8221;<br
/> else<br
/> T=/tmp/backup.fail<br
/> echo &#8220;Date: $(date)&#8221;&gt;$T<br
/> echo &#8220;Hostname: $(hostname)&#8221; &gt;&gt;$T<br
/> echo &#8220;Backup failed&#8221; &gt;&gt;$T<br
/> sendmail &#8220;BACKUP FAILED&#8221; &#8220;$EMAILID&#8221; &lt;$T<br
/> rm -f $T<br
/> echo &quot;ALL Bad $?&quot;<br
/> fi</p><p>if [ &quot;$?&quot; -eq &quot;0&quot; ]; then<br
/> echo &quot;This is good after $?&quot;<br
/> else<br
/> echo &quot;This is bad after $?&quot;<br
/> fi</p><p>Result from this is:<br
/> test.sh: 42: ead: not found<br
/> This is bad before 1<br
/> All Good 0<br
/> This is good after 0</p><p>I am completely stumped.  Any ideas?  Thanks</p><p>Casey</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-43907</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Thu, 01 Oct 2009 10:49:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-43907</guid> <description>look like problem with the if statement.</description> <content:encoded><![CDATA[<p>look like problem with the if statement.</p> ]]></content:encoded> </item> <item><title>By: Casey</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-43906</link> <dc:creator>Casey</dc:creator> <pubDate>Thu, 01 Oct 2009 10:32:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-43906</guid> <description>Hi Vivek,
Thanks for the above.  I have implemented this and it has been working fine for many months now.
Just recently however I have noticed a problem with the last part of the code.  I am not sure if this has been going on all the time or not, but I have was just doing a general check up on the backups and noticed an error.
The section below is the culprit:
### Find out if ftp backup failed or not ###
if [ &quot;$?&quot; == &quot;0&quot; ]; then
rm -f $BACKUP/*
else
T=/tmp/backup.fail
echo &quot;Date: $(date)&quot;&gt;$T
echo &quot;Hostname: $(hostname)&quot; &gt;&gt;$T
echo &quot;Backup failed&quot; &gt;&gt;$T
sendmail &quot;BACKUP FAILED&quot; &quot;$EMAILID&quot; &lt;$T
rm -f $T
fi
I actually get an error:
[: 83: ==: unexpected operator
As you can see I have amended the mail part to sendmail as the other one was not working and hence this is the reason why I spotted the other problem.
Do you know why this is happening?  I have unbuntu 8.04.
Any help much appreciated.  Thanks
Casey</description> <content:encoded><![CDATA[<p>Hi Vivek,</p><p>Thanks for the above.  I have implemented this and it has been working fine for many months now.</p><p>Just recently however I have noticed a problem with the last part of the code.  I am not sure if this has been going on all the time or not, but I have was just doing a general check up on the backups and noticed an error.</p><p>The section below is the culprit:<br
/> ### Find out if ftp backup failed or not ###<br
/> if [ "$?" == "0" ]; then<br
/> rm -f $BACKUP/*<br
/> else<br
/> T=/tmp/backup.fail<br
/> echo &#8220;Date: $(date)&#8221;&gt;$T<br
/> echo &#8220;Hostname: $(hostname)&#8221; &gt;&gt;$T<br
/> echo &#8220;Backup failed&#8221; &gt;&gt;$T<br
/> sendmail &#8220;BACKUP FAILED&#8221; &#8220;$EMAILID&#8221; &lt;$T<br
/> rm -f $T<br
/> fi</p><p>I actually get an error:<br
/> [: 83: ==: unexpected operator</p><p>As you can see I have amended the mail part to sendmail as the other one was not working and hence this is the reason why I spotted the other problem.</p><p>Do you know why this is happening?  I have unbuntu 8.04.</p><p>Any help much appreciated.  Thanks</p><p>Casey</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-42592</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Fri, 17 Jul 2009 13:24:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-42592</guid> <description>Find this line
&lt;pre&gt;# Store backup path
BACKUP=&quot;/backup/$NOW&quot;&lt;/pre&gt;
Append:
&lt;pre&gt;EXCLUDE_CONF=&quot;/root/exclude.files.conf&quot;&lt;/pre&gt;
Find Line:
&lt;pre&gt;# Backup websever dirs
$TAR -zcvf ${BACKUP}/${BFILE} &quot;${DIRS}&quot;&lt;/pre&gt;
Update it as follows:
&lt;pre&gt;# Backup websever dirs
$TAR  --exclude-from=${EXCLUDE_CONF} -zcvf ${BACKUP}/${BFILE} &quot;${DIRS}&quot;&lt;/pre&gt;
Save and close the file. Create/root/exclude.files.conf file:
&lt;pre&gt;vi /root/exclude.files.conf&lt;/pre&gt;
To exclude all log files and a directory called /home/vivek/mp3 enter:
&lt;pre&gt;/var/www/logs/*.logs
/home/vivek/mp3&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Find this line</p><pre># Store backup path
BACKUP="/backup/$NOW"</pre><p>Append:</p><pre>EXCLUDE_CONF="/root/exclude.files.conf"</pre><p>Find Line:</p><pre># Backup websever dirs
$TAR -zcvf ${BACKUP}/${BFILE} "${DIRS}"</pre><p>Update it as follows:</p><pre># Backup websever dirs
$TAR  --exclude-from=${EXCLUDE_CONF} -zcvf ${BACKUP}/${BFILE} "${DIRS}"</pre><p>Save and close the file. Create/root/exclude.files.conf file:</p><pre>vi /root/exclude.files.conf</pre><p>To exclude all log files and a directory called /home/vivek/mp3 enter:</p><pre>/var/www/logs/*.logs
/home/vivek/mp3</pre>]]></content:encoded> </item> <item><title>By: Casey</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-42591</link> <dc:creator>Casey</dc:creator> <pubDate>Fri, 17 Jul 2009 13:16:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-42591</guid> <description>Hi Vivek,
Thanks for the great script.
Is there anyway to add an exclude directory list in this script?  Thanks
Kind regards
Casey</description> <content:encoded><![CDATA[<p>Hi Vivek,</p><p>Thanks for the great script.</p><p>Is there anyway to add an exclude directory list in this script?  Thanks</p><p>Kind regards</p><p>Casey</p> ]]></content:encoded> </item> <item><title>By: devarajan</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-41964</link> <dc:creator>devarajan</dc:creator> <pubDate>Mon, 08 Jun 2009 06:07:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-41964</guid> <description>hi , we r using apache  for mailserver . just i want to back the mails .....
could u can give me any scripts for me .</description> <content:encoded><![CDATA[<p>hi , we r using apache  for mailserver . just i want to back the mails &#8230;..<br
/> could u can give me any scripts for me .</p> ]]></content:encoded> </item> <item><title>By: IndianWebhost</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-39744</link> <dc:creator>IndianWebhost</dc:creator> <pubDate>Wed, 07 Jan 2009 12:35:10 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-39744</guid> <description>Nice script. Thanks for sharing your resource.
Are there any scripts for taking backups for windows server?</description> <content:encoded><![CDATA[<p>Nice script. Thanks for sharing your resource.<br
/> Are there any scripts for taking backups for windows server?</p> ]]></content:encoded> </item> <item><title>By: Samir</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38490</link> <dc:creator>Samir</dc:creator> <pubDate>Mon, 04 Aug 2008 14:59:37 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38490</guid> <description>Concise and useful, a well written script.
Thanks for the effort.</description> <content:encoded><![CDATA[<p>Concise and useful, a well written script.<br
/> Thanks for the effort.</p> ]]></content:encoded> </item> <item><title>By: Liju</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38481</link> <dc:creator>Liju</dc:creator> <pubDate>Sun, 03 Aug 2008 16:24:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38481</guid> <description>Excelent Notes.. Vivek
resync command will be best if you have limited bandwidth on backup server.
Also lftp is also support to incremental backup in between the linux servers which support only ftp access in to it.</description> <content:encoded><![CDATA[<p>Excelent Notes.. Vivek</p><p>resync command will be best if you have limited bandwidth on backup server.</p><p>Also lftp is also support to incremental backup in between the linux servers which support only ftp access in to it.</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38474</link> <dc:creator>vivek</dc:creator> <pubDate>Sat, 02 Aug 2008 18:50:55 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38474</guid> <description>&lt;em&gt;Are you concerned about pwd in plaintext?&lt;/em&gt;
Not much.. if attacker can read my script password, he/she has full access to system. There is no simple solution for password. Usually, I lockdown httpd, named, other service is jail. Continues monitoring and patching prevents lots of bad stuff.
HTH</description> <content:encoded><![CDATA[<p><em>Are you concerned about pwd in plaintext?</em><br
/> Not much.. if attacker can read my script password, he/she has full access to system. There is no simple solution for password. Usually, I lockdown httpd, named, other service is jail. Continues monitoring and patching prevents lots of bad stuff.</p><p>HTH</p> ]]></content:encoded> </item> <item><title>By: dj</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38473</link> <dc:creator>dj</dc:creator> <pubDate>Sat, 02 Aug 2008 18:43:20 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38473</guid> <description>Nice script. Are you concerned about pwd in plaintext? Falisafe should be Failsafe in comment :-) We use a combo for daily and monthly, system and user. And use tape and disk. We looked at DVD UDF packet writing format, but decided against it.
Depending on your needs ZAmanda is very nice. Like any product the configuration took a little to understand, but it wasn&#039;t bad, and I believe they also have a GUI now.  We liked it over Baccula because it uses tar or dump.
http://www.zmanda.com/
I didn&#039;t find the O&#039;Reilly book, &quot;Backup and Recovery&quot; very helpful. It&#039;s too high level, and the good stuff is all on their website or available online elsewhere.</description> <content:encoded><![CDATA[<p>Nice script. Are you concerned about pwd in plaintext? Falisafe should be Failsafe in comment :-) We use a combo for daily and monthly, system and user. And use tape and disk. We looked at DVD UDF packet writing format, but decided against it.</p><p>Depending on your needs ZAmanda is very nice. Like any product the configuration took a little to understand, but it wasn&#8217;t bad, and I believe they also have a GUI now.  We liked it over Baccula because it uses tar or dump.<br
/> <a
href="http://www.zmanda.com/" rel="nofollow">http://www.zmanda.com/</a></p><p>I didn&#8217;t find the O&#8217;Reilly book, &#8220;Backup and Recovery&#8221; very helpful. It&#8217;s too high level, and the good stuff is all on their website or available online elsewhere.</p> ]]></content:encoded> </item> <item><title>By: S. Nilesh</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38471</link> <dc:creator>S. Nilesh</dc:creator> <pubDate>Sat, 02 Aug 2008 16:15:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38471</guid> <description>superb man... a marvellous script.</description> <content:encoded><![CDATA[<p>superb man&#8230; a marvellous script.</p> ]]></content:encoded> </item> <item><title>By: Diya</title><link>http://www.cyberciti.biz/faq/how-to-back-up-a-web-server/#comment-38468</link> <dc:creator>Diya</dc:creator> <pubDate>Sat, 02 Aug 2008 12:55:06 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1291#comment-38468</guid> <description>Excellent and simple to the point.</description> <content:encoded><![CDATA[<p>Excellent and simple to the point.</p> ]]></content:encoded> </item> </channel> </rss>
