cron installed by default fails with “exec: fstrim-all: not found”












1















/etc/cron.weekly/fstrim: is installed by default (confirmed by https://unix.stackexchange.com/a/254840/92199)



Unfortunately for me it keeps generating



/etc/cron.weekly/fstrim:
/etc/cron.weekly/fstrim: 10: exec: fstrim-all: not found
run-parts: /etc/cron.weekly/fstrim exited with return code 127


failures (delivered via local mails).



I have a SSD so I would prefer to avoid just deleting this task.



I found that fstrim-all used to be in util-linux package but I already have it installed (and anyway in xenial it is gone)



mateusz@grisznak:~$ sudo apt-get install util-linux
[sudo] password for mateusz:
Reading package lists... Done
Building dependency tree
Reading state information... Done
util-linux is already the newest version (2.27.1-6ubuntu3.6).


This tool fails not only in cron environment:



mateusz@grisznak:~$ fstrim-all
fstrim-all: command not found


My system version:



mateusz@grisznak:~$ uname -a
Linux grisznak 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


How can I get regular fstrim working? Or maybe it is OK to delete this task despite that I have SSD?










share|improve this question

























  • Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

    – Arronical
    Jan 24 at 10:57











  • There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

    – LeonidMew
    Jan 24 at 10:59






  • 1





    Whats output of which fstrim ? May be adding full path to cron job will help

    – LeonidMew
    Jan 24 at 11:01











  • @Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

    – Mateusz Konieczny
    Jan 24 at 11:02











  • @LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

    – Mateusz Konieczny
    Jan 24 at 11:10
















1















/etc/cron.weekly/fstrim: is installed by default (confirmed by https://unix.stackexchange.com/a/254840/92199)



Unfortunately for me it keeps generating



/etc/cron.weekly/fstrim:
/etc/cron.weekly/fstrim: 10: exec: fstrim-all: not found
run-parts: /etc/cron.weekly/fstrim exited with return code 127


failures (delivered via local mails).



I have a SSD so I would prefer to avoid just deleting this task.



I found that fstrim-all used to be in util-linux package but I already have it installed (and anyway in xenial it is gone)



mateusz@grisznak:~$ sudo apt-get install util-linux
[sudo] password for mateusz:
Reading package lists... Done
Building dependency tree
Reading state information... Done
util-linux is already the newest version (2.27.1-6ubuntu3.6).


This tool fails not only in cron environment:



mateusz@grisznak:~$ fstrim-all
fstrim-all: command not found


My system version:



mateusz@grisznak:~$ uname -a
Linux grisznak 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


How can I get regular fstrim working? Or maybe it is OK to delete this task despite that I have SSD?










share|improve this question

























  • Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

    – Arronical
    Jan 24 at 10:57











  • There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

    – LeonidMew
    Jan 24 at 10:59






  • 1





    Whats output of which fstrim ? May be adding full path to cron job will help

    – LeonidMew
    Jan 24 at 11:01











  • @Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

    – Mateusz Konieczny
    Jan 24 at 11:02











  • @LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

    – Mateusz Konieczny
    Jan 24 at 11:10














1












1








1








/etc/cron.weekly/fstrim: is installed by default (confirmed by https://unix.stackexchange.com/a/254840/92199)



Unfortunately for me it keeps generating



/etc/cron.weekly/fstrim:
/etc/cron.weekly/fstrim: 10: exec: fstrim-all: not found
run-parts: /etc/cron.weekly/fstrim exited with return code 127


failures (delivered via local mails).



I have a SSD so I would prefer to avoid just deleting this task.



I found that fstrim-all used to be in util-linux package but I already have it installed (and anyway in xenial it is gone)



mateusz@grisznak:~$ sudo apt-get install util-linux
[sudo] password for mateusz:
Reading package lists... Done
Building dependency tree
Reading state information... Done
util-linux is already the newest version (2.27.1-6ubuntu3.6).


This tool fails not only in cron environment:



mateusz@grisznak:~$ fstrim-all
fstrim-all: command not found


My system version:



mateusz@grisznak:~$ uname -a
Linux grisznak 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


How can I get regular fstrim working? Or maybe it is OK to delete this task despite that I have SSD?










share|improve this question
















/etc/cron.weekly/fstrim: is installed by default (confirmed by https://unix.stackexchange.com/a/254840/92199)



Unfortunately for me it keeps generating



/etc/cron.weekly/fstrim:
/etc/cron.weekly/fstrim: 10: exec: fstrim-all: not found
run-parts: /etc/cron.weekly/fstrim exited with return code 127


failures (delivered via local mails).



I have a SSD so I would prefer to avoid just deleting this task.



I found that fstrim-all used to be in util-linux package but I already have it installed (and anyway in xenial it is gone)



mateusz@grisznak:~$ sudo apt-get install util-linux
[sudo] password for mateusz:
Reading package lists... Done
Building dependency tree
Reading state information... Done
util-linux is already the newest version (2.27.1-6ubuntu3.6).


This tool fails not only in cron environment:



mateusz@grisznak:~$ fstrim-all
fstrim-all: command not found


My system version:



mateusz@grisznak:~$ uname -a
Linux grisznak 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


How can I get regular fstrim working? Or maybe it is OK to delete this task despite that I have SSD?







16.04 ssd cron






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 24 at 10:52









Arronical

13.3k84791




13.3k84791










asked Jan 24 at 10:09









Mateusz KoniecznyMateusz Konieczny

588627




588627













  • Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

    – Arronical
    Jan 24 at 10:57











  • There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

    – LeonidMew
    Jan 24 at 10:59






  • 1





    Whats output of which fstrim ? May be adding full path to cron job will help

    – LeonidMew
    Jan 24 at 11:01











  • @Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

    – Mateusz Konieczny
    Jan 24 at 11:02











  • @LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

    – Mateusz Konieczny
    Jan 24 at 11:10



















  • Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

    – Arronical
    Jan 24 at 10:57











  • There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

    – LeonidMew
    Jan 24 at 10:59






  • 1





    Whats output of which fstrim ? May be adding full path to cron job will help

    – LeonidMew
    Jan 24 at 11:01











  • @Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

    – Mateusz Konieczny
    Jan 24 at 11:02











  • @LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

    – Mateusz Konieczny
    Jan 24 at 11:10

















Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

– Arronical
Jan 24 at 10:57





Was this upgraded from a previous release? I don't have fstrim-all in the /etc/cron.weekly/fstrim file on a 16.04 machine. Instead it contains fstrim --all || true.

– Arronical
Jan 24 at 10:57













There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

– LeonidMew
Jan 24 at 10:59





There are no space before --all. Don't remove that cron job, its needed for ssd. You can even make it daily instead of weekly.

– LeonidMew
Jan 24 at 10:59




1




1





Whats output of which fstrim ? May be adding full path to cron job will help

– LeonidMew
Jan 24 at 11:01





Whats output of which fstrim ? May be adding full path to cron job will help

– LeonidMew
Jan 24 at 11:01













@Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

– Mateusz Konieczny
Jan 24 at 11:02





@Arronical Thanks! It was a fresh install rather than an upgrade, but maybe backup restore managed to override also this file. Can you turn it into the answer?

– Mateusz Konieczny
Jan 24 at 11:02













@LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

– Mateusz Konieczny
Jan 24 at 11:10





@LeonidMew "daily" Can you make a new answer in unix.stackexchange.com/questions/218076/… (with some source?) Let me know that you posted answer with a good source and I will give you a bounty.

– Mateusz Konieczny
Jan 24 at 11:10










1 Answer
1






active

oldest

votes


















2














The /etc/cron.weekly/fstrim file on my 16.04 system contains the following:



#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true


This specifies the absolute path to the fstrim binary and uses the --all option. It's not clear why the version you have differs, though it matches the file I found on a 14.04 installation.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112455%2fcron-installed-by-default-fails-with-exec-fstrim-all-not-found%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    The /etc/cron.weekly/fstrim file on my 16.04 system contains the following:



    #!/bin/sh
    # trim all mounted file systems which support it
    /sbin/fstrim --all || true


    This specifies the absolute path to the fstrim binary and uses the --all option. It's not clear why the version you have differs, though it matches the file I found on a 14.04 installation.






    share|improve this answer




























      2














      The /etc/cron.weekly/fstrim file on my 16.04 system contains the following:



      #!/bin/sh
      # trim all mounted file systems which support it
      /sbin/fstrim --all || true


      This specifies the absolute path to the fstrim binary and uses the --all option. It's not clear why the version you have differs, though it matches the file I found on a 14.04 installation.






      share|improve this answer


























        2












        2








        2







        The /etc/cron.weekly/fstrim file on my 16.04 system contains the following:



        #!/bin/sh
        # trim all mounted file systems which support it
        /sbin/fstrim --all || true


        This specifies the absolute path to the fstrim binary and uses the --all option. It's not clear why the version you have differs, though it matches the file I found on a 14.04 installation.






        share|improve this answer













        The /etc/cron.weekly/fstrim file on my 16.04 system contains the following:



        #!/bin/sh
        # trim all mounted file systems which support it
        /sbin/fstrim --all || true


        This specifies the absolute path to the fstrim binary and uses the --all option. It's not clear why the version you have differs, though it matches the file I found on a 14.04 installation.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 24 at 11:23









        ArronicalArronical

        13.3k84791




        13.3k84791






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112455%2fcron-installed-by-default-fails-with-exec-fstrim-all-not-found%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?