ℹ️
Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
rebuild index from command line
  • Hi, Is there a way to rebuild index from command line? I'd like to run some cronjob that create some files like fp-content/content/YEAR/MONTH/entryDATE-TIME.txt My only problem is that I have to log in to web interface and run rebuild index manually. Could anyone give advice how to do it without logging into the GUI? Thanks Gabor
  • Use this code, it expects your flatpress root directory as first parameter. #!/usr/bin/php dodo('rebuild'); return; ?>
  • Cool, it works! Thanks!
  • May I ask why you need this?
  • Sure. I spend most of my time in command line, sometimes i don't have time (or don't want) to open a browser, and create a new entry in my blog, so I just create the text and put the file in to the correct place, and run index rebuild. Or simply create a post from my daily tweets from twitter. So let say, at every 10pm I run a cronjob that collect all my tweets on today, creates a summary and put it into a flatfile under fp-content/content/YEAR/MONTH. Now I can have a 'local backup' of my tweets and visitors who are not familiar with Twitter can see my thoughts what was in my mind during the day ;-)
  • great. but still have problem ... i am using that code with "include" and it works well. but we are using a own interface for writing article, because we need multiple users. After the code finised, there should not be "DONE - Please, select the back arrow in your browser", there should be a redirect like "header("Location:http://www.domain.de/directory/file.html");". Is this possible?
  • Yes, of course it is possible. Why don't you just do it?
This discussion has been closed.
All Discussions
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion