Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for crontab

July 7, 2019

Display Instance ID & IP Address

How to display IP address and Instance ID on web page behind a AWS load balancer.

Add these 2 commands in crontab. The job runs every 5 mins.

*/5 * * * * /usr/bin/curl http://169.254.169.254/latest/meta-data/instance-id > /var/www/html/id.txt
*/5 * * * * /usr/bin/curl http://169.254.169.254/latest/meta-data/public-ipv4 > /var/www/html/ip.txt

*/5 * * * * /usr/bin/curl http://169.254.169.254/latest/meta-data/instance-id > /var/www/html/id.txt */5 * * * * /usr/bin/curl http://169.254.169.254/latest/meta-data/public-ipv4 > /var/www/html/ip.txt

You can view on the site.

# your domain
http://yourdomain.com/ip.txt
http://yourdomain.com/id.txt
# your server ip address
http://1.1.1.1/ip.txt
http://1.1.1.1/id.txt

# your domain http://yourdomain.com/ip.txt http://yourdomain.com/id.txt # your server ip address http://1.1.1.1/ip.txt http://1.1.1.1/id.txt

June 16, 2019

Crontab Editor

If you want to change the crontab editor, run the following:

$ select-editor

$ select-editor

Choose one.

June 12, 2019

Crontab File

How to load crontab from file.

crontab /path/to/file.txt

crontab /path/to/file.txt

Save crontab to a file.

crontab -l > /path/to/file.txt

crontab -l > /path/to/file.txt

  • 1
  • 2
  • Next Page »
  • Cloud
  • Linux
  • Git

Copyright © 2012–2021