Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yellowtip

macrumors newbie
Original poster
Jun 11, 2007
27
0
I have this really nice rsync backup script that I use to do rotating snapshot backups of my different Ubuntu servers to a single backup server.

I am now trying to use this same script on my Leopard machine, but it seems to have a serious problem with the following lines of code:

lday=`date +'image-%Y-%m-%d-%H' -d '1 day ago'`
lweek=`date +'image-%Y-%m-%d-%H' -d '1 week ago'`

The generate the following error:
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

It's clear that it doesn't like the -d '1 day ago' part in my code.

Is this solved differently in Leopard?

Could someone please help me out? I've be trying to research this for the past 8 hours, but can't seem to find any solution to this problem.

Thanks in advance.
 

yellowtip

macrumors newbie
Original poster
Jun 11, 2007
27
0
After almost 50 views does nobody have a clue about this issue?

I'm no hardcore programmer, but I figure this 'date -d' function is a pretty regular thing. If it doesn't work, it would be a major flaw in the otherwise beautiful Leopard OS.

Anybody...please????? :confused:
 

yellowtip

macrumors newbie
Original poster
Jun 11, 2007
27
0
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.