hostname in crontab
Hi,
I am a total Linux Newbie, so this might be (too) easy for you :) I am running a Synology NAS and have to replace an IP address in crontab by the dyndns hostname crontab looks like: 20 4,16 * * * root /bin/dl-lesenx -i 192.178.55.22:40000 --res --dir /volume1/public/transfer/ how can I replace IP address:Port by hostname:Port ? txs Charlie |
Code:
crontab -e Code:
man crontab |
I wasn't clear enough, I am afraid
I know how to edit, but can I replace 20 4,16 * * * root /bin/dl-lesenx -i 192.178.55.22:40000 --res --dir /volume1/public/transfer/ by 20 4,16 * * * root /bin/dl-lesenx -i bigboy.selfip.net:40000 --res --dir /volume1/public/transfer/ |
edit /etc/hosts,
Code:
192.178.55.22 bigboy.selfip bigboy Code:
ping bigboy.selfip Then you can utilize "poor man's dns". Code:
20 4,16 * * * root /bin/dl-lesenx -i bigboy.selfip.net:40000 --res --dir /volume1/public/transfer/ |
Sorry, Mr sainoh: you asked in newbies and told us how simple to expect it to be... Back in the good old days before DHCP I had to keep /etc/hosts so people didn't have to remember IP addresses. Even after I still did it for a while; I forget why. Mr Habitual has the correct answer; there's still fun to be had assigning addresses in /etc/hosts. A forgotten old comedy troupe has some odd videos only available at an IP address (at least that's all Google returned); I added a domain for them in /etc/hosts so I didn't have to remember it.
|
The question its still vague. Is 192.178.55.22 a public address or typo?
If the OP is using a dynamic IP service for their public IP address then adding a line to the /etc/hosts file will fail when it changes. If by dyndns your only referring to your local router DHCP then you should be able to configure any device with a static IP or use the routers address resveration feature which most have these days. If your asking can you change from an IP address to hostname from a program perspective then it depends on the meaning of the -i option. I am unfamiliar with dl-lesenx. If your asking can you change from a crontab perspective then yes. Most distributions are configured to use vim and you can find lots of guides on using its commands. |
All times are GMT -5. The time now is 05:56 AM. |