How to activate CRON for CLI Import

Discussion in 'Common issues' started by paul dubois, Nov 20, 2017.

  1. paul dubois

    paul dubois New Member

    Joined:
    Nov 2, 2017
    Messages:
    14
    Likes Received:
    5
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hello,

    1) how to activate the CRON for CLI import (in order to import files in queue ?)
    (apps/common/runtime/list-import-queue/)

    2) is the an API documentation in order to know all available functions on Mailwizz ?

    Thanks in advance for your help.

    Regards.
     
    Ibrahim Sharif likes this.
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,380
    Likes Received:
    2,411
    Go in backend > settings > import/export and click the info icon for each of the import options ;)

    You mean API functions, or general functions available in mailwizz?
    If the first, see https://github.com/twisted1919/mailwizz-php-sdk
     
  3. paul dubois

    paul dubois New Member

    Joined:
    Nov 2, 2017
    Messages:
    14
    Likes Received:
    5
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hello,

    thanks for your answer,

    but 1) i created my list ad imported files in Queue since 3 or 4 hours (and nothing is imported)
    import.jpg

    2) i activated the CLI import
    => after that, should i go to write into the crontab file ? or something like that ?
    what should i write
    - this ? */5 * * * * php -q /var/www/mw/apps/console/console.php list-importer folder > /dev/null 2>&1
    list-empty.png
    sorry, i'm not an expert.
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,380
    Likes Received:
    2,411
    Yes exactly. You have to add this cron job in the same way you have added the ones at install, remember ?
    let me know if unclear ;)

    This is the correct cron job:
    */5 * * * * php -q /var/www/mw/apps/console/console.php list-import folder >/dev/null 2>&1
     
  5. paul dubois

    paul dubois New Member

    Joined:
    Nov 2, 2017
    Messages:
    14
    Likes Received:
    5
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    This is the correct cron job:
    */5 * * * * php -q /var/www/mw/apps/console/console.php list-import folder >/dev/null 2>&1[/QUOTE]

    Thank you for your answer ...
    just a question by a newbie ...
    here is my crontab file (using putty)

    crontab.jpg

    1) i inserted my lines
    2)how to save the file ? (eache time i do "Ctrl + X", nothing happens it just added this sign "^X")

    Thanks for your help.
     
  6. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,380
    Likes Received:
    2,411
    With waht editor did you open that?
    If it's VI, then when you are done editing, press ESC which will take you out of insert mode, then press Shift followed by the letter Z two times.
     
  7. paul dubois

    paul dubois New Member

    Joined:
    Nov 2, 2017
    Messages:
    14
    Likes Received:
    5
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    I'm using putty ...
    i launched the "crontab -e" command
     
  8. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    it is probly editor 'vi', so try exit with saving
    :x
    (those are not mwz questions, so perhaps try google, but for reference: https://www.cs.colostate.edu/helpdocs/vi.html)
     
  9. paul dubois

    paul dubois New Member

    Joined:
    Nov 2, 2017
    Messages:
    14
    Likes Received:
    5
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Thanks for your help ...
    finally i downloaded the file on my descktop ... and modified it ...

    it was faster (after more than 2 hours, tring to modified it using command lines).

    regards.
     
    frm.mwz likes this.
  10. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    maybe for next time
    use editor 'nano'
    for crontab like this
    env EDITOR=nano crontab -e
    ;)
     
    twisted1919 likes this.
  11. Miltan Chaudhury

    Miltan Chaudhury New Member

    Joined:
    Sep 9, 2018
    Messages:
    3
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    For cron based automatic CSV import via CLI, What is the location of the folder to store the csv files? (I just started using it)
     
  12. Miltan Chaudhury

    Miltan Chaudhury New Member

    Joined:
    Sep 9, 2018
    Messages:
    3
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hi, what is the directory to store/save the CSV file to import? (Sorry, I am new to this software)
     
  13. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,380
    Likes Received:
    2,411
    @Miltan Chaudhury - You don't have to worry about that, you simply upload the file like you usually do, then mailwizz does the rest. You just make sure you add the cron job.
     
  14. Miltan Chaudhury

    Miltan Chaudhury New Member

    Joined:
    Sep 9, 2018
    Messages:
    3
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
  15. Francisco Irigoite

    Francisco Irigoite New Member

    Joined:
    Apr 14, 2019
    Messages:
    1
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Extended
    L.C:
    1
    upload_2019-4-29_14-33-14.png

    this task can not perform any solution?
     
  16. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,380
    Likes Received:
    2,411
    @Francisco Irigoite - you need to add it just like the other mailwizz cron jobs. What you see is examples which you have to adapt to your server, so, for example, duplicate your send-campaigns cron jobs but this time instead of the words send-campaigns, you put list-import folder.
     

Share This Page