Author Topic: cron  (Read 6084 times)

philb

  • Posts: 13
    • View Profile
cron
« on: February 24, 2005, 09:34:45 am »
My domain host has cron capabilities. However, they don't support cron.
I have asked them to enter the command for me but they won't.
My question is: How do I actually enter the command into the cron file?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #1 on: February 24, 2005, 02:55:05 pm »
You may be able to enter it in your control panel.  There should be a section called "Cron" or "Crontab" or "Cron Jobs".

If your host supports it, but it's not possible via the control panel, you might have to access an SSH shell and type "crontab -e" to use the (complicated) Linux vi editor.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #2 on: February 24, 2005, 03:04:59 pm »
What is an SSH Shell? I'm no programmer.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #3 on: February 24, 2005, 03:43:57 pm »
An SSH shell is when you open a Linux-based "command prompt" on the server, remotely.  Your host says they provide cron capabilities but don't support it.  Maybe they will answer you if you ask them where and how you might set up your own cron task?

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #4 on: February 24, 2005, 04:11:05 pm »
I have found the cron folder through my ftp program. I just need to know the steps to enter the command line into the folder, I assume.
All this is Greek to me. It has taken me most of the day to set up the rest of this program. All I lack is this last phase.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #5 on: February 24, 2005, 06:11:10 pm »
Does a file already exist in the cron folder?  You may need to edit an existing file.  If not, I suspect that you need to upload a (certain type of?) file containing your complete cron commandline, including timing, as per the Dailymail help page.  

Is there any documentation on their web site at all about how these might be entered?
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #6 on: February 25, 2005, 03:36:58 am »
Dean,

Here is the original file that is in my cron folder:
http://www.augusta-real-estate.com/pbrealty

I used wordpad to edit it. However, the file saves as a TEXT file. What type file does it need to be and how can I save it with that particular file extension.

Thanks for your prior help. I'm a Realtor not a programmer.

philb

  • Posts: 13
    • View Profile
cron
« Reply #7 on: February 25, 2005, 03:48:58 am »
Here is the file I edited:
http://www.augusta-real-estate.com/pbrealty1.txt

I realize I have to replace "YourDailyMailPass" with my password.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #8 on: February 25, 2005, 01:03:54 pm »
Okay, I cant guarantee this will run properly because of the filename... Your host should really have an explanation on HOW to use cron on your server.  This is ridiculous.  We are both stabbing in the dark.  Ever thought about switching hosts?  Maybe if you suggest that you're thinking about it they'll help you at least with HOW TO set up your own cron task..  (We're not asking for support, just HOW is it done.  ie: what FILE in what DIR do we need to modify).

I notice something wrong with the contents of your file:

0 0 * * * /usr/bin/wget -O /dev/null -T 0 http://www.pbrealty.com/pbrealtymail/dailymail.php?pw=YourDailyMailPass 1> /dev/null2> /dev/null

There needs to be a space after "1> /dev/null" and before "2> /dev/null".

Regards,
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #9 on: February 25, 2005, 02:33:25 pm »
That particular file is in my cron folder. It is the only file in the folder.

What should the file extension be? Isn't this your field of expertise?

Maybe someone else who uses your program has solved this problem. My web host is jumpline.com? Do you know if any of your other clients use this same web host. Surely, this problem has been run into by others.

And yes, I did threaten them. However, they have been very good in the past.  Their prices are very good but most importantly, their uptime is great. 100% most months. Maybe I'm just hooking up with idiots whenever I contact them. I truely believe they just don't know how to do it and don't want to admit it.

Their servers are Redhat Linux Enterprise Edition servers, if that makes any difference.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #10 on: February 25, 2005, 05:15:48 pm »
I don't see cron in their documentation under "Advanced" but they say it's there so maybe we can figure it out.

I believe that if any file exists in the cron directory it will be run at the interval set for that directory.  Do you have directories called, for instance, "cron.daily", or "cron.hourly"?

I am fairly certain that files in a cron directory can have any extension to be executed, but they must be executable.  In your FTP program, right click on the file and choose "Permissions".  Make the Linux permissions "755" (or just make sure it's executable for all types of users).

In that file, set up a "shell" script with 2 lines:

Code: [Select]
#!/bin/sh
/usr/bin/wget -O /dev/null -T 0 http://yoursite.com/mail/dailymail.php?pw=YourDailyMailPass 1> /dev/null 2> /dev/null

If the cron folder does not have a descriptive name for the timing, then it could work differently.  From my experience I believe you may have to edit a specific filename which might already be created in the folder.  The file should contain your lines of cron including timing.  The file would not have to be executable, and should contain a single line that might look like (timing for 1:10am):

Code: [Select]
10 1 * * * /usr/bin/wget -O /dev/null -T 0 http://yoursite.com/mail/dailymail.php?pw=YourDailyMailPass 1> /dev/null 2> /dev/null
If none of this works via FTP you might want to access the SSH shell, which appears to be a part of your hosting package as per their help page.

A free SSH client is available here.

You will likely need to connect with your FTP username and password.  Once connected and at a Linux prompt, follow these instructions.

When you save the cron file it should say something like "crontab updated".

If you do access the shell, it's a good idea to check if "wget" is available.  Type in "which wget" at the prompt and it should show you the complete path to the program.  If it says "not found" we might have to look into an alternative for use with your cron task and CGI scripts, such as "curl", or "fetch".

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #11 on: February 26, 2005, 02:39:45 pm »
I don't find a cron.daily or cron.hourly directory. The only folder I find is a cron folder which contains the pbrealty file.

When I right click on the pbrealty file, I get choices like "open", "properties", and some other choices. There is no "permissions" choice.

When I click on "properties" of the pbrealty file, I can change the CHMOD which is set at 400 now. Is this what you are talking about?

philb

  • Posts: 13
    • View Profile
cron
« Reply #12 on: February 26, 2005, 03:54:05 pm »
I've tried the putty.exe program.

Everything seems to go fine until I type ":wq" and hit "Enter". I get a "permission denied message".

However, when I hit "enter" after typing the last "/null", it takes it and doesn't give me a "permission denied message".

Also, when I type"which wget" and hit "enter", the next line shows "bin/wget".

This is a big pain in the butt. Am I the only one who has ever had this problem.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
cron
« Reply #13 on: February 27, 2005, 02:38:50 pm »
No, you're not the only one who has has this type of problem.  Every server is different.  It can be really easy on some hosts and practically impossible (on hosts like yours) for someone experienced.

I understand you must be becoming frustrated.  Have you considered changing hosts?  DreamHost is just $7.95/mo and I would be willing to offer you a free installation.  Alternately, you could order a Server Analysis so I can take a look an do my best.

To continue troubleshooting, I would say this:

From the shell, what happens if you try to run wget at the ListMail default path, by typing in:

/usr/bin/wget

If this doesn't run the program you'll need to update your cron task and .CGI files, if used (i suspect them to be too difficult on your server) to use the correct path to wget.

It sounds like you need to enter your cron tasks into the pbrealty file found in the cron folder you speak of.  Since it's already created, the permissions should be fine.  Try modifying this file, either via SSH shell, or via Right-Click -> Edit in FTP, to contain your cron line, including timing and the correct path to wget, ie (1:10am each day, all on one line!):

10 1 * * * /usr/bin/wget -O /dev/null -T 0 http://yoursite.com/mail/dailymail.php?pw=YourDailyMailPass 1> /dev/null 2> /dev/null

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

philb

  • Posts: 13
    • View Profile
cron
« Reply #14 on: February 28, 2005, 02:45:52 pm »
I may have this system set up (but don't count on it).

What is the best way to test it and make sure the crom is set up right?

I received a mailing report today but it contained nothing.

Also, a person at http://hostingpub.com/about.html has made me an attractive offer on hosting my 12 websites. I think he or she is one of your clients ( bhl007 username).
They must be foreign because their email english is horrible. Are you familiar with this web host. According to their website, they are housed in a high technology building in Texas, I think.

Thanks.