WordPress.org

Ready to get started?Download WordPress

Forums

Tweak export function: make the export planned (2 posts)

  1. csseur3
    Member
    Posted 5 years ago #

    Hello,

    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=<code>date +%Y-%m-%d</code>
    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

  2. csseur3
    Member
    Posted 5 years ago #

    it seems that it's doesn't works under WP since 2.5

    what is changing?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags