Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Scheduled Task to publish pages

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1157 Views
  • timp
    Avatar
    Community Member
    4 Posts

    Scheduled Task to publish pages Link to this post

    Hi,

    I'm creating a site that scans a directory, and imports the contents of xml files it finds in the directory as new pages, it all works nicely, but now I'm trying to set up a scheduled task to automate the process, but I'm running into an issue.

    if i run it through my browser, it all works fine, but when i run it from cron with lynx, as I'm not logged in, the pages are created, but not published.
    is there an easy way to publish pages without being logged in?

    Cheers,
    Tim

  • craesh
    Avatar
    Community Member
    25 Posts

    Re: Scheduled Task to publish pages Link to this post

    Hi Tim!

    This is just an idea, I've not tested it: In the changelog for 2.4 they say "Automatically login user if the 'remember login' cookie is set ", maybe you can use this cookie to automatically log in your lynx or wget (both support cookies). If not, you can always log in by submitting the login-form (at least wget supports the POST method) and storing the session cookie for later use. You may have to handle all this in a simple shell script.

    Greetings!
    craesh

    1157 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.