• With CFDB v2.63, on Worpress 3.3.1, I use a cron job that successfully creates a CSV and stores it on the server every day:

    wget -O FILENAME.CSV https://WEBSITE.COM/wp-admin/admin-ajax.php?action=cfdb-export&form=FILENAME&show=(FIELDS TO SHOW)&enc=CSVUTF8

    With CFDB v2.8.32, and WP 4.1.1 this same and similar cron jobs only produce an empty csv, no data.

    Any idea what would cause this failure / how to adjust for the new version(s) if that’s the culprit?

    https://www.ads-software.com/plugins/contact-form-7-to-database-extension/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Possible problem is that the wget is not logging into the site?

    Try: from CFDB Short Code page, re-create the download link. Put that in a new browser where you are NOT logged in to your WP site. Verify that works. If not, in the Short Code page add login info and try again. When you get it to work, try that with wget.

    Thread Starter tlulax

    (@tlulax)

    The Short Code works perfectly on all browsers without login, but I tried adding login to the cron job just to be sure. Wget still creates an empty file. Cpanel sends the following…


    –2015-03-09 08:23:02– https://WEBSITE.com/wp-admin/admin-ajax.php?action=cfdb-export
    Resolving WEBSITE.com… 111.222.333.444
    Connecting to WEBSITE.com|111.222.333.444|:80… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: unspecified [text/csv]
    Saving to: `FILENAME.csv’

    0K 138K=0s

    2015-03-09 08:23:03 (138 KB/s) – `FILENAME.csv’ saved [1]

    This is identical to the working version except for the Names/IPs and the end result.

    Plugin Author Michael Simpson

    (@msimpson)

    I got this to work for me on the command line.

    From the short code builder page, I selected a form, Export File of type CSV, and I put in my WP login information. It generated a link like this:

    https://SITE.com/wp-admin/admin-ajax.php?action=cfdb-login&cfdb-action=cfdb-export&form=FORM&enc=CSVUTF8BOM&l=aaaaaaaaaaaaa

    From the command line, I use wget and I quote the URL:

    wget -O my.csv "https://SITE.com/wp-admin/admin-ajax.php?action=cfdb-login&cfdb-action=cfdb-export&form=FORM&enc=CSVUTF8BOM&l=aaaaaaaaaaaaa"

    Thread Starter tlulax

    (@tlulax)

    Thanks so much for your help Michael.

    I still get an empty CSV, and Cpanel sends me this:

    /usr/local/cpanel/bin/jailshell: cfdb-action=cfdb-export: command not found

    The “not found” message goes away if I remove the login & password.

    Also, if I quote the URL I get this:

    /usr/local/cpanel/bin/jailshell: -c: line 0: unexpected EOF while looking for matching `”‘
    /usr/local/cpanel/bin/jailshell: -c: line 1: syntax error: unexpected end of file

    As I mentioned, everything still works fine on the old combo of WP/ CFDB & FSCF, so I’ve got 3 potential culprits in every test. But the CFDB codes always work in my browser – just not in cron. So I’m pretty sure I need to look elsewhere.

    Plugin Author Michael Simpson

    (@msimpson)

    The issue appears to be how the jailshell parses the command line. You need to escape the & and ?. Quoting worked for me using bash, but you need to figure out what works for that shell.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cron job builds an empty CSV’ is closed to new replies.