#!/bin/bash<br>yesteday=$(date -d &#39;yesterday&#39; +%_d)<br>today=$(date +%_d)<br><br>if [ $today -lt $yesterday ]; then<br> monthly<br>else<br> incremental<br>fi<br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 11:41 AM, Robert L. Harris <span dir="ltr">&lt;<a href="mailto:robert.l.harris@gmail.com">robert.l.harris@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
<br>
Ok, simple one...  I have a script that has this:<br>
<br>
<br>
#!/bin/bash<br>
<br>
date=`date +%d`<br>
if [ $date = &quot;01&quot; ]; then<br>
   # Run Monthly Backup<br>
else<br>
   # Run Incremental Backup<br>
fi<br>
<br>
- From the man page of &#39;date&#39;:<br>
         %d     day of month (e.g, 01)<br>
<br>
And when I set it up last year, it did run a full on 11/01/2010.  But<br>
now it&#39;s not.  Going to convert it to a numerical &#39;-eq&#39; comparison but<br>
it&#39;s still got me wondering why it&#39;s picking the wrong date.  Any ideas?<br>
<br>
Robert<br>
<br>
- --<br>
<br>
:wq!<br>
====================================================================<br>
Robert L. Harris                     | GPG Key ID: E344DA3B<br>
                                         @ x-hkp://<a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>
DISCLAIMER:<br>
      These are MY OPINIONS             With Dreams To Be A King,<br>
       ALONE.  I speak for              First One Should Be A Man<br>
       no-one else.                       - Manowar<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
<br>
iEYEARECAAYFAk4m9x8ACgkQ8+1vMONE2jvuSgCgmi/771au8rOxhSLm0iwfuJ4x<br>
aV8AnjfTb/21A/w4PBUfCnZ1G7CcPKxl<br>
=UYaq<br>
-----END PGP SIGNATURE-----<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><br>As long as the general population is passive, apathetic, diverted to 
consumerism or hatred of the vulnerable, then the powerful can do as 
they please, and those who survive will be left to contemplate the 
outcome.<br>- <i><i><i><i>2011 Noam Chomsky<br><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br></i></i></i></i><br>