Join the community today
Become a Member

WebPerf optimise-images.sh IMAGICK_WEBPLOSSLESS

Discussion in 'Web Development & Web Performance' started by adamus007p, Mar 31, 2020.

  1. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    Hello,

    What is for IMAGICK_WEBPLOSSLESS an option in optimise-images.sh ?
    How it works?

    I was trying to find this in manual.

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You can search optimise-images.sh github repo too centminmod/optimise-images

     
  3. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    lossless or glossy - what is the difference?

    is it like here?


    GLOSSY COMPRESSION
    Glossy is the best choice if you still care about Google Insights but you believe that a slight loss of page speed is an acceptable compromise for a top notch image quality.

    LOSSLESS COMPRESSION
    Lossless optimized images are pixel-by-pixel identical with the originals, but they offer a smaller size reduction compared to either Lossy or Glossy processed files. If you want your images to remain untouched, then select this option.

    source: https://shortpixel.com/online-image-compression

    What is by default?



    2. I was using default option and my jpg were optimized too.

    a. How to do not optimize original jpgs? Leave orginal JPG, PNGs not changed.
    b. How I can increase the quality of optimized jpgs?
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    default is glossy in optimise-images.sh for smaller image sizes for webP

    default for optimise-images.sh is to optimise for jpeg/jpg and png. There's is no picking just one nor is there an option to improve quality (increase size of images)
     
  5. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM

    I mean I have original jpg which is ok. After the optimization the optimized jpg is not good, not too sharp.
    How can I change it to have after optimization of original jpg better quality?
     
  6. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    When I have used`IMAGICK_WEBPLOSSLESS='y'` I have no webP created. Is it correct?
     
  7. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should create webP files if IMAGICK_WEBP='y' is also set or you use optimise-webp command flag outlined at centminmod/optimise-images or optimise-webp-nginx command flag centminmod/optimise-images
     
  8. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    Code (Text):
    IMAGICK_RESIZE='y'
    IMAGICK_JPEGHINT='y'
    IMAGICK_QUALITY='90'
    IMAGICK_WEBP='y'
    IMAGICK_WEBP_CONDITIONAL='y'
    IMAGICK_WEBPQUALITY='75'
    IMAGICK_WEBPQUALITYALPHA='100'
    IMAGICK_WEBPMETHOD='4'
    IMAGICK_WEBPLOSSLESS='y'
    IMAGICK_WEBPTHREADS='1'
    
    other things which I have changed
    GALLERY_WEBP='n'
    UNATTENDED_OPTIMISE='y'
    ADD_COMMENT='y'
    nothing more
    


    with
    IMAGICK_WEBPLOSSLESS='y'

    it did not create a webP.

    I will make another test.

    My command was
    Code (Text):
    find /home/images90weblossless -type d | sort | while read d; do echo "optimise-webp-nginx directory: $d"; echo "/root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d"; /root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d; done




    when the was
    IMAGICK_WEBPLOSSLESS='n'

    I have got generated webP files.


    2. Is it possible to increase IMAGICK_WEBPQUALITY='75' ??
     
    Last edited: Apr 6, 2020
  9. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    I have make a test again with above command

    My test folder have:
    sample png with spaces in naminge like: my image 1.png
    and jpg names like: my_sample_1.jpg.

    I have used command:

    Code (Text):
    find /home/images90weblossless -type d | sort | while read d; do echo "optimise-webp-nginx directory: $d"; echo "/root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d"; /root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d; done
    
    and option Y
    IMAGICK_WEBPLOSSLESS='y'



    I have noticed that when there was spaces in name like "my samples image.png" only when IMAGICK_WEBPLOSSLESS='y' I see errors.

    Code:
    ### My samples image name. 1.png (png) ###
    /bin/nice -n 10 /usr/bin/ionice -c2 -n7 /usr/bin/convert -define registry:temporary-path=/home/imagicktmp My samples image name. 1.png -interlace none -set comment optimised -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=2             -write mpr:My samples image name. 1 -resize 2048x2048\> -write My samples image name. 1.png +delete             mpr:My samples image name. 1 -define webp:thread-level=1 -define webp:method=4 -define webp:lossless=true -resize 2048x2048\> My samples image name. 1.png.webp
    removing My samples image name. 1.png.webp
    image size larger than original 395356 >
    /bin/nice -n 10 /usr/bin/ionice -c2 -n7 optipng -o2 My samples image name. 1.png -preserve -out My samples image name. 1.png
    Output IDAT size = 514302 bytes (38433 bytes decrease)
    Output file size = 514604 bytes (38625 bytes = 6.98% decrease)
    stat: cannot stat ā€˜/home/image90IMAGICK_WEBPLOSSLESSy/600x600/Next: No such file or directory
    stat: cannot stat ā€˜Image’: No such file or directory
    stat: cannot stat ā€˜Sample2.png’: No such file or directory
    
    Here my png are not changed to webP.

    When I changed spaces to - I have got webP from png.

    But only from PNG.
    Not Jpg.


    When the option is IMAGICK_WEBPLOSSLESS='n' I can see webP for jpg and png. For both and there is no error even names are with spaces my image 1.png.



    To test:
    sample name 1.jpg



    Is it normal that when IMAGICK_WEBPLOSSLESS='y' only png is converted to WebP?
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    sounds like you ran into a bug in optimise-images.sh so I'll have to investigate for now you can just leave IMAGICK_WEBPLOSSLESS='n'

    but it's recommended practice to never name image of files with spaces in their names ;)

    edit: managed to test a fix for actual webP conversion with spaces in file names but it breaks the auto nginx gallery routine which generates a gallery of original vs webp images due to spaces in file names

    Code (Text):
    ls -lah /home/optimise-benchmarks | egrep '\.png|\.webp'
    -rw-r--r--   1 root root 172K Apr  6 02:34 bees name 1.png
    -rw-r--r--   1 root root  11K Apr  6 02:34 bees name 1.png.webp
    -rw-r--r--   1 root root 172K Apr  6 02:34 bees name.png
    -rw-r--r--   1 root root  11K Apr  6 02:34 bees name.png.webp
    -rw-r--r--   1 root root 172K Apr  6 02:34 bees.png
    -rw-r--r--   1 root root  11K Apr  6 02:34 bees.png.webp
    -rw-r--r--   1 root root 378K Apr  6 02:34 png24-image1.png
    -rw-r--r--   1 root root  29K Apr  6 02:34 png24-image1.png.webp
    -rw-r--r--   1 root root 434K Apr  6 02:34 png24-interlaced-image1.png
    -rw-r--r--   1 root root  29K Apr  6 02:34 png24-interlaced-image1.png.webp
    -rw-r--r--   1 root root 1.2M Apr  6 02:34 webp-study-source-firebreathing.png
    -rw-r--r--   1 root root  77K Apr  6 02:34 webp-study-source-firebreathing.png.webp
    

    what i do for gallery generation is fine the original and webp version and try to use xargs -0 -n2 to match 2 full paths at a time for original + webp full path filenames but with spaces in it, it breaks the match
    Code (Text):
    find /home/optimise-benchmarks -maxdepth 1 -name '*.jpg' -o -name '*.png' -o -name '*.jpeg' -o -name '*.webp' | sort | xargs -0 -n2 | while read x y; do echo "$x"; echo; echo "$y"; done

    example broken output
    Code (Text):
    find /home/optimise-benchmarks -maxdepth 1 -name '*.jpg' -o -name '*.png' -o -name '*.jpeg' -o -name '*.webp' | sort | xargs -0 -n2 | while read x y; do echo "$x"; echo; echo "$y"; done
    /home/optimise-benchmarks/bees
    name 1.png
    /home/optimise-benchmarks/bees
    name 1.png.webp
    /home/optimise-benchmarks/bees
    name.png
    /home/optimise-benchmarks/bees
    name.png.webp
    /home/optimise-benchmarks/bees.png
    /home/optimise-benchmarks/bees.png.webp
    /home/optimise-benchmarks/png24-image1.png
    /home/optimise-benchmarks/png24-image1.png.webp
    /home/optimise-benchmarks/png24-interlaced-image1.png
    /home/optimise-benchmarks/png24-interlaced-image1.png.webp
    /home/optimise-benchmarks/webp-study-source-firebreathing.png
    /home/optimise-benchmarks/webp-study-source-firebreathing.png.webp
    

    so what usually happens is to match groupings of 2 at a time to look like
    Code (Text):
    /home/optimise-benchmarks/bees name 1.png
    /home/optimise-benchmarks/bees name 1.png.webp
    

    where original file is assigned variable X and webP one is assigned variable Y

    but with spaces it ends up like
    Code (Text):
    /home/optimise-benchmarks/bees
    name 1.png
    /home/optimise-benchmarks/bees
    name 1.png.webp
    

    will need to figure that out to fix nginx webP comparison gallery html generation

    but will update the fix for webP conversion with spaces in filenames for now

    edit: updated optimise-images.sh to fix nginx webP comparison gallery HTML generation routine now, just did a workaround to loop through non-webP filenames and just infer .webp version instead so when /home/optimise-benchmarks/bees.png is found, just infer /home/optimise-benchmarks/bees.png.webp with .webp suffix for webP version instead fix webP mode's nginx gallery HTML generation routine Ā· centminmod/optimise-images@b23eebc
     
  11. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    I have change all spaces to - but I see that when IMAGICK_WEBPLOSSLESS='y' only png is converted to WebP.

    IMAGICK_WEBPLOSSLESS='y'
    jpg are not conferted to webp
    png are converted to webp

    @eva2000 is it normal or bug?

    IMAGICK_WEBPLOSSLESS='n'
    jpg are conferted to webp
    png are converted to webp


    I do not use gallery. It is off << n.
     
    Last edited: Apr 7, 2020
  12. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    check the generated log of your optimise run for more details

    or

    you can do a test and copy the problematic jpg files to a test directory and run webP conversion mode on that directory with IMAGICK_WEBPLOSSLESS='y' and then share the generated log output via pastebin.com or gist.github.com link
     
  13. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Note webP files are only created and kept if the webP file is smaller than original file size. If webP file is larger than original file size, then webP version is removed

    example below is with
    Code (Text):
    IMAGICK_WEBPLOSSLESS='y'
    IMAGICK_WEBP='y'
    

    from logged and displayed output note the image = samsung_s7_mobile_1.jpg reports webP is larger than original so wasn't kept for webP file so it's missing from profile output further below
    Code (Text):
    ### samsung_s7_mobile_1.jpg (jpg) ###
    /bin/nice -n 10 /usr/bin/ionice -c2 -n7 /usr/bin/convert -define registry:temporary-path=/home/imagicktmp samsung_s7_mobile_1.jpg -define jpeg:size=4096x4096 -filter triangle -define filter:support=2 -define jpeg:fancy-upsampling=off -unsharp 0.25x0.08+8.3+0.045 -interlace none -strip             -write mpr:samsung_s7_mobile_1 -resize 2048x2048\> -write samsung_s7_mobile_1.jpg +delete             mpr:samsung_s7_mobile_1 -define webp:thread-level=1 -define webp:method=4 -define webp:lossless=true -resize 2048x2048\> samsung_s7_mobile_1.jpg.webp
    removing samsung_s7_mobile_1.jpg.webp
    image size larger than original 2203840 > 2100858
    

    Code (Text):
    image name : width : height : quality : transparency : image depth (bits) : size : user: group
    ------------------------------------------------------------------------------
    images in /home/optimise-benchmarks
    logged at /home/optimise-logs/profile-log-070420-005705.log
    ------------------------------------------------------------------------------
    image : bees.png : 444 : 258 : 92 : False : 8 : 175256 : root : root
    image : bees.png.webp : 444 : 258 : 100 : False : 8 : 146884 : root : root
    image : dslr_canon_eos_m6_1.jpg : 1200 : 800 : 82 : False : 8 : 161442 : root : root
    image : dslr_nikon_d7200_1.jpg : 2048 : 1365 : 82 : False : 8 : 377126 : root : root
    image : dslr_nikon_d7200_1.jpg.webp : 2048 : 1365 : 100 : False : 8 : 2797544 : root : root
    image : dslr_nikon_d7200_2.jpg : 1365 : 2048 : 82 : False : 8 : 520565 : root : root
    image : dslr_nikon_d7200_2.jpg.webp : 1365 : 2048 : 100 : False : 8 : 2560216 : root : root
    image : png24-image1.png : 600 : 400 : 92 : False : 8 : 386063 : root : root
    image : png24-image1.png.webp : 600 : 400 : 100 : False : 8 : 317882 : root : root
    image : png24-interlaced-image1.png : 600 : 400 : 92 : False : 8 : 443931 : root : root
    image : png24-interlaced-image1.png.webp : 600 : 400 : 100 : False : 8 : 317882 : root : root
    image : samsung_s7_mobile_1.jpg : 2048 : 1536 : 82 : False : 8 : 259901 : root : root
    image : webp-study-source-firebreathing.png : 1024 : 752 : 92 : False : 8 : 1194070 : root : root
    image : webp-study-source-firebreathing.png.webp : 1024 : 752 : 100 : False : 8 : 972676 : root : root
    ------------------------------------------------------------------------------
    Original or Existing Images:
    ------------------------------------------------------------------------------
    | Avg width | Avg height | Avg quality | Avg size   | Total size (Bytes) | Total size (KB) |
    | --------- | ---------- | ----------- | --------   | ------------------ | --------------- |
    | 1166      | 945        | 87          | 439794     | 3518354            | 3436            |
    ------------------------------------------------------------------------------
    Optimised WebP Images:
    ------------------------------------------------------------------------------
    | Avg width | Avg height | Avg quality | Avg size   | Total size (Bytes) | Total size (KB) |
    | --------- | ---------- | ----------- | --------   | ------------------ | --------------- |
    | 1014      | 870        | 100         | 1185514    | 7113084            | 6946            |
    

    because you enable IMAGICK_WEBPLOSSLESS='y', webP files are lossless and high quality they result in webP files larger than original format as seen in profile output webP images total size 6946KB being larger than optimised image total size = 3436KB. But with default IMAGICK_WEBPLOSSLESS='n' for lossy webP, the webP files are generally smaller than original so more likely to keep the converted webP files
     
    Last edited: Apr 7, 2020
  14. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    added a note in readme file on optimise-images github repo at centminmod/optimise-images

    edit: though i think i found a bug in that sometimes webP files are kept if they're larger than original - so that could an issue when IMAGICK_WEBPLOSSLESS='y' set

    edit 2: i've fixed the webP file size check so when IMAGICK_WEBPLOSSLESS='y' set, you may get less converted webP files retained and removed instead as the probability of them being larger than original file format size is much higher

    example of fixed run's profile output when IMAGICK_WEBPLOSSLESS='y' is set
    Code (Text):
    ------------------------------------------------------------------------------
    image profile 
    image name : width : height : quality : transparency : image depth (bits) : size : user: group
    ------------------------------------------------------------------------------
    images in /home/optimise-benchmarks
    logged at /home/optimise-logs/profile-log-070420-012832.log
    ------------------------------------------------------------------------------
    image : bees.png : 444 : 258 : 92 : False : 8 : 175256 : root : root
    image : bees.png.webp : 444 : 258 : 100 : False : 8 : 146884 : root : root
    image : dslr_canon_eos_m6_1.jpg : 1200 : 800 : 82 : False : 8 : 161442 : root : root
    image : dslr_nikon_d7200_1.jpg : 2048 : 1365 : 82 : False : 8 : 377126 : root : root
    image : dslr_nikon_d7200_2.jpg : 1365 : 2048 : 82 : False : 8 : 520565 : root : root
    image : png24-image1.png : 600 : 400 : 92 : False : 8 : 386063 : root : root
    image : png24-image1.png.webp : 600 : 400 : 100 : False : 8 : 317882 : root : root
    image : png24-interlaced-image1.png : 600 : 400 : 92 : False : 8 : 443931 : root : root
    image : png24-interlaced-image1.png.webp : 600 : 400 : 100 : False : 8 : 317882 : root : root
    image : samsung_s7_mobile_1.jpg : 2048 : 1536 : 82 : False : 8 : 259901 : root : root
    image : webp-study-source-firebreathing.png : 1024 : 752 : 92 : False : 8 : 1194070 : root : root
    image : webp-study-source-firebreathing.png.webp : 1024 : 752 : 100 : False : 8 : 972676 : root : root
    

    notice alot of webP versions are missing as they were larger than originals
    Code (Text):
    ------------------------------------------------------------------------------
    image optimisation start
    ------------------------------------------------------------------------------
    ### dslr_nikon_d7200_1.jpg (jpg) ###
    /bin/nice -n 10 /usr/bin/ionice -c2 -n7 /usr/bin/convert -define registry:temporary-path=/home/imagicktmp dslr_nikon_d7200_1.jpg -define jpeg:size=4096x4096 -filter triangle -define filter:support=2 -define jpeg:fancy-upsampling=off -unsharp 0.25x0.08+8.3+0.045 -interlace none -strip             -write mpr:dslr_nikon_d7200_1 -resize 2048x2048\> -write dslr_nikon_d7200_1.jpg +delete             mpr:dslr_nikon_d7200_1 -define webp:thread-level=1 -define webp:method=4 -define webp:lossless=true -resize 2048x2048\> dslr_nikon_d7200_1.jpg.webp
    removing dslr_nikon_d7200_1.jpg.webp
    image size larger than original 2797544 > 1255848
    
     
    Last edited: Apr 7, 2020
  15. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    Hello, yes I have noticed the same things that new webp was bigger then original and that's why was a problem.


    Is it a change to do not change jpg but just generate webp.

    How I have increased jpg quality to 90%.
    What happen when I will write 100%?

    Which command should I use to use it with cron?

    At the moment I use:

    Code (Text):
    find /home/images90weblossless -type d | sort | while read d; do echo "optimise-webp-nginx directory: $d"; echo "/root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d"; /root/tools/optimise-images/optimise-images.sh optimise-webp $d; done



    How to use it with cron?
     
  16. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    With new update of optimise-images.sh.
    Is start to install something but there was some error due to disk space.

    I reboot the VPS and mysql did not go up. I had error.

    Code (Text):
    service mysqld status
    Redirecting to /bin/systemctl status mysqld.service
    ? mariadb.service - MariaDB 10.3.22 database server
       Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/mariadb.service.d
               L¦migrated-from-my.cnf-settings.conf, openfileslimit.conf, protecthome.conf
       Active: failed (Result: exit-code) since Tue 2020-04-07 19:41:02 UTC; 1h 51min ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 1920 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
      Process: 1042 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
      Process: 1012 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
     Main PID: 1920 (code=exited, status=1/FAILURE)
       Status: "MariaDB server is down"
    
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [ERROR] Plugin 'InnoDB' init function returned error.
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [Note] Plugin 'FEEDBACK' is disabled.
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [ERROR] Unknown/unsupported storage engine: InnoDB
    Apr 07 19:41:02 la11.domain.com mysqld[1920]: 2020-04-07 19:41:02 0 [ERROR] Aborting
    Apr 07 19:41:02 la11.domain.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
    Apr 07 19:41:02 la11.domain.com systemd[1]: Failed to start MariaDB 10.3.22 database server.
    Apr 07 19:41:02 la11.domain.com systemd[1]: Unit mariadb.service entered failed state.
    Apr 07 19:41:02 la11.domain.com systemd[1]: mariadb.service failed.
    You have new mail in /var/spool/mail/root


    mysqlrestart helped.

    Ok my fault it is a disk space run out.
    The script was not installed correctly and it make a problem with database.
    I need to delete few copies.
     
    Last edited: Apr 8, 2020
  17. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    optimise-images.sh would not have caused this so separate issue. But if you rebooted server in middle of a mysql activity to databases you could of corrupted your databases on server. Never use a server reboot as a means of fixing issues as you can risk corrupting and loosing data. You'd have to start a separate thread in mysql forum for your mysql issue and there's no guarantee I can provide free support for such a resolution either
     
  18. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    It is my fault - no space.

    How to create a cron with the script?

    Code (Text):
    find /home/images90weblossless -type d | sort | while read d; do echo "optimise-webp-nginx directory: $d"; echo "/root/tools/optimise-images/optimise-images.sh optimise-webp-nginx $d"; /root/tools/optimise-images/optimise-images.sh optimise-webp $d; done
     
    Last edited: Apr 8, 2020
  19. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah yes if you run out of disk space = bad !

    best way is create a shell script for that find command at maybe /root/tools/webp-cron.sh and give it executable /root/tools/webp-cron.sh permissions
    Code (Text):
    chmod +x /root/tools/webp-cron.sh

    then add a cronjob schedule for running /root/tools/webp-cron.sh using crontab -e to invoke nano linux editor

    use crontab -l to view current cronjobs and crontab -e command to invoke nano text editor see guide at HowTo: Add Jobs To cron Under Linux or UNIX?

    example of out of box centmin mod setup cronjobs excluding wordpress wp-cli
    Code (Text):
    crontab -l
    13 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh >/dev/null 2>&1
    0 */4 * * * /usr/bin/cminfo_updater 2>/dev/null
    
     
  20. adamus007p

    adamus007p Member

    371
    18
    18
    Feb 8, 2019
    Ratings:
    +36
    Local Time:
    8:08 PM
    Thank you :)


    Is my command is correct?

    How to update script optimise-images.sh to the newest version?


    I will make tests and update here.

    I am wondering if it will be working with Cloudflare or Cloudfront.