SQLDATE="2014-01-28 11:07:10"
# или
SQLDATE=`./check.sh`
DATE_SQL=`date --date="$SQLDATE" +"%s"`
DATE_NOW=`date +"%s"`
DATE_DIFF_MINUTES=$[ ($DATE_NOW - $DATE_SQL) / 60 ]
if [ $DATE_DIFF_MINUTES -gt 20 ]; then
# do stuff
fi
date --date="2014-01-28 11:07:10 +04:00"
/usr/bin/mysqldump -u dbuser -p"userpass" database > db.sql 2> /tmp/log
location /admin {
return 301 https://example.com/$request_uri;
}