I have a server that I have a web cam on and the server is set to Ottawa Canada time.
I have a new webcam that I want to run from the same server in Ottawa but the Image will be from Australia. My problem is as follows:
I have 'date' functions in the script to add dates to the image and also used in the script. They all work fine for the Ottawa image as 'date' is Ottawa Canada but I need a way to run the Australian scripts in that timezone on the server using Ottawa time.
I am not a programmer so the code is probably really bad but it works for Ottawa. I tried to add this line but that did not zone for 'date'
Quote:
date=$(TZ=Australia/Canberra date '+%Y-%m-%d %H:%M')
|
An example is as follows:
Quote:
THISMONTH=$(date +%B)
THISDAY=$(date +%d)
LASTMONTH=$(date -d "-1 month" +%B)
THISYEAR=$(date +%Y)
LASTYEAR=$(date -d "-12 month" +%Y)
LASTNUM=$(date -d "-1 month" +%m)
echo $THISYEAR
echo $LASTYEAR
if [[ $THISDAY = "02" ]]
then
echo "This must be the second"
echo 0 > /home/www/localhost/htdocs/scripts/merimbula/webcam_counter_avi
echo "reset webcam_counter_avi to 0"
fi
if [[ $THISMONTH = "January" && $THISDAY = "01" ]]
then
echo "This must be 01 January"
THISYEAR=$LASTYEAR
fi
|
Any help would be appreciated.