Scheduling posts on MT

apps

#1

MT=Movable type.
Scheduling posts=future posts feature.
I know that I have to go to MT’s installation/manual support for that. I did. Here’s what they say:

cron

If you have shell access to a Unix server you can set up scheduled posting by editing your crontab, the table the cron utility uses to store its assignments:

% crontab -e

Then add the following line:

0,15,30,45 * * * * cd /path/to/mt/; ./tools/run-periodic-tasks

This instructs cron to run the script at zero, fifteen, thirty, and forty-five minutes after the hour, every hour. The asterisks are a way of telling cron to do this every hour, every day, every day of the week and month. Make sure you have exactly four asterisks separated by spaces.
/path/to/mt/ should be the path to your Movable Type application directory.

After that, just save the file, exiting your editor, and cron will report that it installed a new crontab.

Excellent…I don’t have the shell access. I’ve downloaded PuTTY, logged in, and it gave me a message that “this account only has FTP access.” So, that’s that. Next:

cPanel

To set up scheduled posting through cPanel, follow these directions:

How do I get to this in cPanel?

In the box labeled [i]“Command to run,”[/i] enter the path to your Movable Type installation, followed by /tools/run-periodic-tasks:

cd /path/to/mt/; ./tools/run-periodic-tasks

The timing options can be set to a schedule that suits you; however, it is not wise to run the script more often than about once every fifteen minutes, since it could bog down your server. We recommend the settings “Every fifteen minutes,” “Every Hour,” “Every Day,” “Every Month,” and “Every Weekday.”

I’m sorry, but where’s that “Command to run” box? And DH’s panel doesn’t look like an ordinary cPanel

Windows

If Movable Type is running on a Windows server, you can create a scheduled task to achieve the same result. Use the following parameters for your task:

How do I get to this in Windows?

  • Name

“Movable Type Tasks”.

  • Run

The run command should be the path and filename of your Perl interpreter (i.e., C:\Perl\bin\perl.exe), followed by tools\run-periodic-tasks.

  • Start In

Should be the full path to your Movable Type directory. Example: C:\Inetpub\wwwroot\mt.

  • Schedule

The timing options can be set to a schedule that suits you, however, it is not wise to run the script more often than about once every fifteen minutes, since it could bog down your server. We recommend a frequency between every fifteen minutes to once a day.

Ok, but I believe this only pertains to your home/no hosting Windows server.

So, the question is how would I go about making the future posts in this case?


#2

I have no experience with MT, but two quick things:

  1. Just edit your user in the control panel and allow shell access. CPanel is very different than DH’s panel, so I’d stick with the shell directions.

  2. If you copy/paste the line into the shell, be sure it doesn’t wrap, or it will probably be a problem.

And Dreamhost uses Linux, so you can skip the Windows section.

It can take a little while for the shell access to be enabled, so you might not be able to log in right away.


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.


#3

And how do I do that? You mean from the Web ID Central? I didn’t see anything that said allow shell access, or anything like that.


#4

It doesn’t have to be a “that’s that” situation. All DH accounts come with shell access available, though shell access must be enabled in the Control Panel(not cPanel, which DH does not use) for your user in order for you to able to use ssh to login to the shell.

Once you have done that, the first set of instructions (“If you have shell access to a Unix server”) in your post will work just fine. If you are not the “master” account holder for the Dreamhost account in question, you may need that master account holder to authorize/set-up your user have shell access enabled, but if you are the account holder, you can do it yourself as described in the wiki link provided above.

You will also find additional information on using the shell and cron in the wiki. Good Luck!

–rlparker


#5

Check my other post in this thread - there is a link to a wiki article on how to do that. The short version is to go to the control panel–=>Manage Users–> and click the “edit” link next to your user…there is a checkbox to enable the shell there.

–rlparker


#6

Ok, reading http://wiki.dreamhost.com/index.php/Enabling_Shell_Access…blah here…blah there…ok, manage users…edit - screw creating the new one [enough as it is]…Enable ssh/telnet? Yes…/bin/bash…wtf is this…ah, let’s stick with the bashing…Ok, Save changes…yes…aha - Successfully edited user! The changes will take a few minutes to take effect.…a few?..it said about 20 minutes in the wiki…ah, whatever makes it work…I’ll wait…


#7

Ok, I got the access…new problem. I’m trying to type this % crontab -e stuff and get nothing since it gives me this:
[tab]$ % crontab
-bash: fg: %: no such job

Great, now since I’m a newbie to all this coding this, is anyone familiar with this / HELP ME PLZ?


#8

oops… I accidentally typed cd … in the PuTTy under my user name and saw all the users in DH system…yikes…is that a bad thing?..


#9

Not really, you will not have any valid permissions for those other user home directories (not even READ).

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#10

Oh, good. The last thing I need is to get into trouble due to my own computer illiteracy. Anyway, how do I get into this cron thingy?


#11

Try crontab -e , without the % :slight_smile:

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#12

Right, yes.
I got into the Cron. I typed crontab -e, not % crontab -e! Wtf is the difference anyway? Well, obviously, there is. Next, I opened the file and what I saw was blank space.
O…k…now I should type 0,15,30,45 * * * * cd /path/to/mt/; ./tools/run-periodic-tasks, just like it said in the MT tutorial.
Great, but what would be the path? Is it just mydomain.com/mt, or is it something else? Also, how do I save Cron?


#13

Ok, I think I’ve just saved the cron file by hitting F2 for Exit and then Y for Yes. Ok, what about the directory/path?


#14

I am not that familiar with MT, but I think the path should be something like the following;

/home/dreamhostusername/domainname.com/mt/

Save File = CTRL O (or press F3)
Exit Editor = CTRL X (or press F2)

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )


#15

Ok, I’ll try home/username/whatever…


#16

Ok, this is what happened:
[tab]$ crontab -e
no crontab for willdex - using an empty one
crontab: installing new crontab
[tab]$ crontab -e
crontab: installing new crontab

I had to re-open the file to add home/willdex/, that’s why you see installing new crontab twice…

So, now I got an email from DH [actually I found out about this email because I saw You have new mail in /home/willdex/Maildir/ right under installing new crontab. Here’s what it says:
/bin/sh: line 1: cd: /mydomainname/: No such file or directory
/bin/sh: line 1: ./tools/run-periodic-tasks: No such file or directory


#17

Being a MT user myself, I can probably be of help here. The easiest thing to do so far as setting up a crontab is this.

1: On your own machine, fire up notepad or an equivalent program. Then, copy and paste the cron line from the MT user manual, changing /path/to/mt to your appropriate directory, in this case /home/username/domain/mt. Remember to make sure the line doesn’t wrap or you’ll have issues.
2: Save the file as crontab.txt. Save it somewhere you’ll remember where it is, because you’re gonna need it in about 30 seconds.
3: Fire up your FTP program, and make sure the transfer type is set to ascii. Connect to your FTP server.
4: Locate and upload crontab.txt, then close your FTP program.
5: Run PuTTY, and log in.
6: At the command prompt, type the following:
crontab crontab.txt

You’ve just set up a crontab the easy way. Anything else you need a hand with, let me know.

Yes, I have an opinion.

Get a minimum 50% off with the “haveadreamyday” promo code, and… have a dreamy day. Original, no?


#18

Locate and upload crontab.txt to where?..
Here’s what I wrote just now in Notepad:
0,15,30,45 * * * * cd /home/willdex/www.mydomain.com/; ./tools/run-periodic-tasks
The reason I put the forward slash at the end is because that’s how it is in the tutorial:
Then add the following line:
0,15,30,45 * * * * cd /path/to/mt/; ./tools/run-periodic-tasks
This instructs cron to run…


#19

Upload it to the root directory on the server; meaning, where you are immediately after you log in via FTP. Also, I hope you 1: replaced mydomain.com with your actual domain name, and 2: didn’t include the www. You’ll end up having issues if you didn’t do either.

Yes, I have an opinion.

Get a minimum 50% off with the “haveadreamyday” promo code, and… have a dreamy day. Original, no?


#20

The root directory on the server. Is it where you can see your domain folders with .alias and .bash_profile?..