Can this addon be used with CRON?

Permalink Browser Info Environment
Can CRON be used to automate an import/update of user accounts from an external file hosted on the webserver? Thanks!

Type: Pre-Sale
Status: In Progress
TeKnoZiz
View Replies:
jshannon replied on at Permalink Reply
jshannon
Not really. You'd need to do some hacking to get it to work, though it'd be possible.

From recollection (it's been years since I worked on the code) the configuration of a particular import is stored in a table. Ie, the file name, whether to use commas, etc. Then I think the actual import is just giving it the config row ID and "go".

So you could have a pretty quick shell script (if you're' familiar with PHP you could also do it as a PHP command line script and then call that from cron) that:

1. Downloads the file from the other webserver and saves it locally. It might have to save it to the local /tmp directory (or wherever PHP typically stores these files).
2. Insert a row (INSERT INTO ...) into the table with the config settings and the new file location. In fact, now that I think through this, it might be possible to simply use an previous ID as long as the file is in the same location.
3. Hit the "start import" URL with something like curl. The only difficulty here is that curl would need to have the cookie for the admin user (or any other user that has access to this) but that's actually not that hard.

I doubt that it's possible to kick this off directly from the command line. IIRC, c5 (especially c5.6) was pretty bad about being able to be accessed fromt he command line. Too many libraries assumed a web environment.

concrete5 Environment Information

# concrete5 Version
5.6.3.4

# concrete5 Packages
Accordion Menu (2.0), Advanced Forms (1.13.2), Dashboard Maximizer (2.0.4), Data Display (2.7.1.4), eCommerce (2.8.18), eCommerce Import (2.4.11), Flowplayer Free (1.2.1), Foundation 5 (1.6.0), List files from set (1.0.4), Magic Data (2.10.10), Magic Data Commerce (1.4.7), Magic Data Symbols1 (2.7.30), Magic Data Templates1 (2.3.2), Page Auto Redirect (2.0), Pro Blog (12.4.4), Register User Pro (1.3.16), tnSpacer (1.3), Upload and Install Packages (0.9.4.2).

# concrete5 Overrides
blocks/autonav, blocks/content, blocks/ff_login, blocks/formidable, blocks/jb_register, blocks/list_files_from_set, blocks/orbit_image_slider, blocks/orbit_slider, blocks/page_list, blocks/problog_list, blocks/product, blocks/product_list, blocks/search, controllers/checkout, elements/cart_item_list.php, elements/checkout, elements/orders, elements/product, js/formatter.js, js/formatter.min.js, js/jquery.formatter.js, js/jquery.formatter.min.js, js/scale.fix.js, css/ccm.base.css, languages/ar, languages/cs_CZ, languages/da_DK, languages/de_DE, languages/el_GR, languages/es_AR, languages/es_ES, languages/es_MX, languages/es_PE, languages/fa_IR, languages/fi_FI, languages/fr_FR, languages/it_IT, languages/ja_JP, languages/nb_NO, languages/nl_NL, languages/pt_PT, languages/ro_RO, languages/ru_RU, languages/sk_SK, languages/sl_SI, languages/sv_SE, languages/tr_TR, languages/vi_VN, languages/zh_TW, single_pages/blogsearch.php, single_pages/checkout, themes/foundation_5, tools/order_print.php

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.6.28

# PHP Extensions
apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, intl, json, ldap, libxml, mbstring, mcrypt, memcached, mhash, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 32M
sql.safe_mode - Off
upload_max_filesize - 32M
ldap.max_links - Unlimited
memcached.sess_lock_max_wait - 0
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.