Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#9903 closed enhancement (invalid)

Tweak export function: make the export planned

Reported by: csseur3's profile csseur3 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Export Keywords: export
Focuses: Cc:

Description

Hello,

i use Wordpress for a xml reader and i need to propose a export xml every hour, but i think a core-function is needed, because the authentification is needed to make an export.

Change History (9)

#1 @ryan
16 years ago

  • Milestone changed from 2.8 to Future Release

Details?

#2 @dd32
16 years ago

I have a feeling they're http-requesting the export page.

My advice, would be to use a output buffer, in combination with export_wp($author_id); (Which prints the export file)

#3 @Denis-de-Bernardy
16 years ago

couldn't this be done like... with a plugin on an hourly cron or something?

#4 @csseur3
16 years ago

i find a hack:

 /bin/bash

# Settings
BACKUP_DIR=/home/toto/ftp
URL=http://www.website.com
USER=admin
PASS=passpass

COOKIES_FILE=/tmp/wp-backup.cookies

# Compute some aliases
DATE=`date +%Y-%m-%d`
BACKUP_FILE=$BACKUP_DIR/wp-backup-$DATE.xml

# Authentication
wget --keep-session-cookies --save-cookies $COOKIES_FILE  --post-data "log=$USER&pwd=$PASS&wp-submit=Connexion&testcookie=1" -O /dev/null "$URL/wp-login.php" > /dev/null

# Get the 'export' xml file
wget -O $BACKUP_FILE --load-cookies $COOKIES_FILE "$URL/wp-admin/export.php?author=all&submit=1&download=true"

chmod 777 $BACKUP_FILE

#end of file

but i have the login page in html format, in the xml backup file :(

what is wrong?

bye

#5 @csseur3
16 years ago

no solution? :(

#6 @Denis-de-Bernardy
16 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

you can use wp_schedule_event() to generate the backup. and wp_set_current_user() if it needs to be "as if it was a particular author".

#7 follow-up: @filosofo
16 years ago

And if you have shell access to your server, why don't you just dump your database? That's a much more robust solution.

#8 in reply to: ↑ 7 @Denis-de-Bernardy
16 years ago

Replying to filosofo:

And if you have shell access to your server, why don't you just dump your database? That's a much more robust solution.

only if the table prefixes aren't the same

#9 @Denis-de-Bernardy
16 years ago

are the same, even

Note: See TracTickets for help on using tickets.