Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-04-2017, 01:38 PM
|
#1
|
LQ Newbie
Registered: Mar 2017
Posts: 4
Rep:
|
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
Last edited by sainoh; 03-04-2017 at 01:40 PM.
|
|
|
03-04-2017, 02:27 PM
|
#2
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,037
|
is how you edit a crontab file. Note that it runs crontab's default editor, usually ed. If you don't want to deal with ed you can change the default editor with an environment variable. Run for more information.
|
|
|
03-04-2017, 02:30 PM
|
#3
|
LQ Newbie
Registered: Mar 2017
Posts: 4
Original Poster
Rep:
|
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/
|
|
|
03-04-2017, 05:48 PM
|
#4
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
edit /etc/hosts,
Code:
192.178.55.22 bigboy.selfip bigboy
then returns 192.178.55.22
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/
Last edited by Habitual; 03-04-2017 at 05:50 PM.
|
|
|
03-04-2017, 09:24 PM
|
#5
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,037
|
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.
|
|
|
03-05-2017, 08:42 AM
|
#6
|
Moderator
Registered: Aug 2002
Posts: 26,201
|
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 10:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|