Created
August 24, 2012 06:51
-
-
Save jsleetw/3446852 to your computer and use it in GitHub Desktop.
ntpdate over http proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date -s "$(wget --no-cache -S -O /dev/null google.com 2>&1 | sed -n -e '/ *Date: */ {' -e s///p -e q -e '}')" |
*/1 * * * * /bin/date -s "$(wget --no-cache -S -O /dev/null google.com 2>&1 | sed -n -e '/ *Date: */ {' -e s///p -e q -e '}')"
set every min auto update time in crontab
exporting http_proxy doesn't help.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And set http_proxy env. variable if you have a proxy server in your way, as:
http_proxy=http://youruser:yourpassword@proxyip:proxyport;export http_proxy