Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Linux: Insert 1 hour old timestamp into wget found in .sh script

I use the following code in a script called updatedb.sh to automatically update a database.

A crontab task is setup to run the script every hour.

Instead of using the hardcoded value of 1372258535 how can I get a timestamp value from one hour ago?

#### updatedb.sh ###
wget https://example.com/data.aspx?modified=1372258535 -q  --output-document /tmp/dataDump.txt
mysql -u DATABASE_USERNAME -pDATABASE_PASSWORD DATABASE_NAME  < /tmp/dataDump.txt
rm /tmp/dataDump.txt

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial