Stephane, I have implemented a --no-prompt command line option for wee_import. --no-prompt will cause 'y' to be automatically accepted for all y/n prompts. To use it you just add it to your existing command line, eg:
$ /home/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-11-15 --no-prompt Since you are using WeeWX v4.2.0 you can try out the --no-prompt capable wee_import as follows (the following assumes you have WeeWX installed in the directory /home/pi/weewx-4.2.0): 1. move aside your existing wee_import and weeimport.py: $ cp /home/pi/weewx-4.2.0/bin/wee_import /home/pi/weewx-4.2.0/bin/wee_import_orig $ cp /home/pi/weewx-4.2.0/bin/weeimport/weeimport.py /home/pi/weewx-4.2.0/bin/weeimport/weeimport_orig.py 2. download the updated wee_import and weeimport.py from github: $ wget -P /home/pi/weewx-4.2.0/bin https://raw.githubusercontent.com/weewx/weewx/wee_import_no_prompt/bin/wee_import $ wget -P /home/pi/weewx-4.2.0/bin/weeimport https://raw.githubusercontent.com/weewx/weewx/wee_import_no_prompt/bin/weeimport/weeimport.py 3. run wee_import with the --help action to see the revised usage: $ /home/pi/weewx-4.2.0/bin/wee_import --help 4. run wee_import with --no-prompt, I suggest you try running wee_import with --no-prompt interactively from the command line before setting your cron script to use it. Please let me know how you go, if successful I will arrange for --no-prompt to be included in the 4.3.0 release. Gary On Friday, 20 November 2020 at 02:54:44 UTC+10 sc.lep...@gmail.com wrote: > Hi Gary, Thanks a lot for your answer ... > there is option - - dry-run so if you can implemente - - no-prompt it > will be very good > Stephane > > Le mardi 17 novembre 2020 à 08:37:56 UTC+1, gjr80 a écrit : > >> Hi, >> >> There is presently no support in wee_import for >> suppressing/bypassing/automatically answering the y/n prompt in >> wee_import, we never envisioned wee_import being used in that manner. >> Implementing something like the --no-prompt command line option in >> wee_config should be possible and fairly straightforward to add. Let me >> do some homework. >> >> Gary >> On Monday, 16 November 2020 at 01:11:16 UTC+10 sc.lep...@gmail.com wrote: >> >>> For the first question I ve my own answer : >>> 2 scripts bash >>> >>> *For night and morning : * >>> #!/bin/bash >>> date_debut_jour_heure=`date +"%Y-%m-%dT00:00"` ; >>> date_fin_jour_heure=`date +"%Y-%m-%dT12:00"` ; >>> >>> echo $date_debut_jour_heure; >>> echo $date_fin_jour_heure; >>> >>> /home/pi/weewx-4.2.0/bin/wee_import --config=/home/weewx/FROGGIT.conf >>> --import-config=/home/weewx/wu-FROGGIT.conf --from=$date_debut_jour_heure >>> --to=$date_fin_jour_heure --dry-run >>> >>> >>> *For afternoon and evening : * >>> >>> #!/bin/bash >>> date_debut_jour_heure=`date +"%Y-%m-%dT12:00"` ; >>> date_fin_jour_heure=`date +"%Y-%m-%dT23:59"` ; >>> >>> echo $date_debut_jour_heure; >>> echo $date_fin_jour_heure; >>> >>> /home/pi/weewx-4.2.0/bin/wee_import --config=/home/weewx/FROGGIT.conf >>> --import-config=/home/weewx/wu-FROGGIT.conf --from=$date_debut_jour_heure >>> --to=$date_fin_jour_heure --dry-run >>> >>> >>> >>> But how to suppress Y/N answer ? >>> >>> thanks >>> >>> Le dimanche 15 novembre 2020 à 15:08:24 UTC+1, sc.lep...@gmail.com a >>> écrit : >>> >>>> Hello >>>> I want to import twice a day ( for example 12h00 and 00h00) my data >>>> from Weather Underground. >>>> >>>> I want to write a script shell to put it in a crontab. >>>> >>>> first question : >>>> I use this : >>>> wee_import --config=/home/weewx/FROGGIT.conf >>>> --import-config=/home/weewx/wu-FROGGIT.conf --date=2020-11-14 >>>> >>>> For midday : ..... - -date is it possible to put - - date >>>> =2020-11-14T12:00 ? >>>> For midnight : ..... - - from=2020-11-14T12:00 - >>>> -to=2020-11-14:23:59 >>>> >>>> >>>> Snd question : I must answer by "y" to proceed import , is is >>>> possible to overwrite this ? >>>> >>>> And if you want to see results , it 's here : >>>> https://meteo-pontscorff.fr/station-froggit-template-belchertown/ >>>> >>>> Thanks a lot , best regards >>>> Stephane >>>> >>>> -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/74b67290-7e94-44c8-96f1-65ff1e4cc282n%40googlegroups.com.