Cron to delete files

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












In Ubuntu 17.10 the command



find /Home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


delete my files older than 1 day. But I have no result in combination with a cron.



Could you please inform me about my mistake in the line below?



My command is:



15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


By Ctrl+O I do see the text:



File Name to Write: tmpcrontab.OV51lh/crontab


I believe the cron is installed correctly because “service cron status” gives the message:



cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: ena
Active: active (running) since Mon 2018-01-29 18:29:16 +07; 5min ago
Docs: man:cron(8)
Main PID: 861 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─861 /usr/sbin/cron -f









share|improve this question























  • Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
    – olikaf
    Jan 29 at 15:01














up vote
0
down vote

favorite












In Ubuntu 17.10 the command



find /Home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


delete my files older than 1 day. But I have no result in combination with a cron.



Could you please inform me about my mistake in the line below?



My command is:



15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


By Ctrl+O I do see the text:



File Name to Write: tmpcrontab.OV51lh/crontab


I believe the cron is installed correctly because “service cron status” gives the message:



cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: ena
Active: active (running) since Mon 2018-01-29 18:29:16 +07; 5min ago
Docs: man:cron(8)
Main PID: 861 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─861 /usr/sbin/cron -f









share|improve this question























  • Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
    – olikaf
    Jan 29 at 15:01












up vote
0
down vote

favorite









up vote
0
down vote

favorite











In Ubuntu 17.10 the command



find /Home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


delete my files older than 1 day. But I have no result in combination with a cron.



Could you please inform me about my mistake in the line below?



My command is:



15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


By Ctrl+O I do see the text:



File Name to Write: tmpcrontab.OV51lh/crontab


I believe the cron is installed correctly because “service cron status” gives the message:



cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: ena
Active: active (running) since Mon 2018-01-29 18:29:16 +07; 5min ago
Docs: man:cron(8)
Main PID: 861 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─861 /usr/sbin/cron -f









share|improve this question















In Ubuntu 17.10 the command



find /Home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


delete my files older than 1 day. But I have no result in combination with a cron.



Could you please inform me about my mistake in the line below?



My command is:



15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$


By Ctrl+O I do see the text:



File Name to Write: tmpcrontab.OV51lh/crontab


I believe the cron is installed correctly because “service cron status” gives the message:



cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: ena
Active: active (running) since Mon 2018-01-29 18:29:16 +07; 5min ago
Docs: man:cron(8)
Main PID: 861 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─861 /usr/sbin/cron -f






cron delete






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 29 at 14:22









clearkimura

3,39711849




3,39711849










asked Jan 29 at 12:02









Edwerf

13




13











  • Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
    – olikaf
    Jan 29 at 15:01
















  • Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
    – olikaf
    Jan 29 at 15:01















Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
– olikaf
Jan 29 at 15:01




Did you try with an external script ? ie write find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete in an executable script like /usr/local/cleanup, and 15 00 * * * /usr/local/cleanup Don't use >$
– olikaf
Jan 29 at 15:01










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Thank you for your help. It's working now.



The correct line must be:



06 19 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete


My mistake was about an extra space and the $ in line:



15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$





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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f1000981%2fcron-to-delete-files%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Thank you for your help. It's working now.



    The correct line must be:



    06 19 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete


    My mistake was about an extra space and the $ in line:



    15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$





    share|improve this answer


























      up vote
      0
      down vote













      Thank you for your help. It's working now.



      The correct line must be:



      06 19 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete


      My mistake was about an extra space and the $ in line:



      15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$





      share|improve this answer
























        up vote
        0
        down vote










        up vote
        0
        down vote









        Thank you for your help. It's working now.



        The correct line must be:



        06 19 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete


        My mistake was about an extra space and the $ in line:



        15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$





        share|improve this answer














        Thank you for your help. It's working now.



        The correct line must be:



        06 19 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete


        My mistake was about an extra space and the $ in line:



        15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 30 at 13:25









        RoVo

        6,0591539




        6,0591539










        answered Jan 30 at 12:17









        Edwerf

        13




        13



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1000981%2fcron-to-delete-files%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491