Debian: Move the trash folder for all users to another volume

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












0















I need to have all deleted files for all users go into a folder on another drive. Is this possible? If so, what are the commands to permanently move the trash folder(s)?



The operating system is Debian Jessie.



Thanks.










share|improve this question
























  • At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

    – fd0
    Jul 21 '15 at 22:36















0















I need to have all deleted files for all users go into a folder on another drive. Is this possible? If so, what are the commands to permanently move the trash folder(s)?



The operating system is Debian Jessie.



Thanks.










share|improve this question
























  • At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

    – fd0
    Jul 21 '15 at 22:36













0












0








0


0






I need to have all deleted files for all users go into a folder on another drive. Is this possible? If so, what are the commands to permanently move the trash folder(s)?



The operating system is Debian Jessie.



Thanks.










share|improve this question
















I need to have all deleted files for all users go into a folder on another drive. Is this possible? If so, what are the commands to permanently move the trash folder(s)?



The operating system is Debian Jessie.



Thanks.







debian trash






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 21 '15 at 15:27







Adrian Leishman

















asked Jul 21 '15 at 15:19









Adrian LeishmanAdrian Leishman

11




11












  • At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

    – fd0
    Jul 21 '15 at 22:36

















  • At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

    – fd0
    Jul 21 '15 at 22:36
















At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

– fd0
Jul 21 '15 at 22:36





At home I do not move the kitchen trash into the living room, so I can empty the kitchen trash. And at work the cleaners empty my trash bin and dispose of the trash nightly. The same policy should be implemented on your cloud server.

– fd0
Jul 21 '15 at 22:36










2 Answers
2






active

oldest

votes


















0














It depends on the way your system is set up. If whenever a file is deleted, it moves it into a trash directory (e.g ~/Trash/) then you can run sudo mv /home/*/Trash/* path-to-drive .

If instead you want to move every file a user deletes into a drive, then you could make a simple script in your /bin directory that goes as follows:

#!/bin/bash
sudo mv $1 path-to-drive


And then name it del. You would just have to add alias rm="del" to your /etc/bash.bashrc...


Cheers,
Interesting...






share|improve this answer























  • This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

    – Adrian Leishman
    Jul 21 '15 at 19:33


















0














Why not just create a soft link with ln?



Rather than copy from another answer here's the link.
Stackoverflow: how to create a link to a directory






share|improve this answer
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f217401%2fdebian-move-the-trash-folder-for-all-users-to-another-volume%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It depends on the way your system is set up. If whenever a file is deleted, it moves it into a trash directory (e.g ~/Trash/) then you can run sudo mv /home/*/Trash/* path-to-drive .

    If instead you want to move every file a user deletes into a drive, then you could make a simple script in your /bin directory that goes as follows:

    #!/bin/bash
    sudo mv $1 path-to-drive


    And then name it del. You would just have to add alias rm="del" to your /etc/bash.bashrc...


    Cheers,
    Interesting...






    share|improve this answer























    • This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

      – Adrian Leishman
      Jul 21 '15 at 19:33















    0














    It depends on the way your system is set up. If whenever a file is deleted, it moves it into a trash directory (e.g ~/Trash/) then you can run sudo mv /home/*/Trash/* path-to-drive .

    If instead you want to move every file a user deletes into a drive, then you could make a simple script in your /bin directory that goes as follows:

    #!/bin/bash
    sudo mv $1 path-to-drive


    And then name it del. You would just have to add alias rm="del" to your /etc/bash.bashrc...


    Cheers,
    Interesting...






    share|improve this answer























    • This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

      – Adrian Leishman
      Jul 21 '15 at 19:33













    0












    0








    0







    It depends on the way your system is set up. If whenever a file is deleted, it moves it into a trash directory (e.g ~/Trash/) then you can run sudo mv /home/*/Trash/* path-to-drive .

    If instead you want to move every file a user deletes into a drive, then you could make a simple script in your /bin directory that goes as follows:

    #!/bin/bash
    sudo mv $1 path-to-drive


    And then name it del. You would just have to add alias rm="del" to your /etc/bash.bashrc...


    Cheers,
    Interesting...






    share|improve this answer













    It depends on the way your system is set up. If whenever a file is deleted, it moves it into a trash directory (e.g ~/Trash/) then you can run sudo mv /home/*/Trash/* path-to-drive .

    If instead you want to move every file a user deletes into a drive, then you could make a simple script in your /bin directory that goes as follows:

    #!/bin/bash
    sudo mv $1 path-to-drive


    And then name it del. You would just have to add alias rm="del" to your /etc/bash.bashrc...


    Cheers,
    Interesting...







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 21 '15 at 19:08









    Interesting...Interesting...

    1,60531118




    1,60531118












    • This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

      – Adrian Leishman
      Jul 21 '15 at 19:33

















    • This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

      – Adrian Leishman
      Jul 21 '15 at 19:33
















    This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

    – Adrian Leishman
    Jul 21 '15 at 19:33





    This is an ownCloud server. When users delete files they go to the Trash just in case they need restored. We need the server to use a MUCH larger drive or it fills up the system drive within a couple of days. So, basically, we need any files deleted to go to a Trash folder on a different volume. I don't know if this is possible.... but I hope it is.

    – Adrian Leishman
    Jul 21 '15 at 19:33













    0














    Why not just create a soft link with ln?



    Rather than copy from another answer here's the link.
    Stackoverflow: how to create a link to a directory






    share|improve this answer





























      0














      Why not just create a soft link with ln?



      Rather than copy from another answer here's the link.
      Stackoverflow: how to create a link to a directory






      share|improve this answer



























        0












        0








        0







        Why not just create a soft link with ln?



        Rather than copy from another answer here's the link.
        Stackoverflow: how to create a link to a directory






        share|improve this answer















        Why not just create a soft link with ln?



        Rather than copy from another answer here's the link.
        Stackoverflow: how to create a link to a directory







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 23 '17 at 12:40









        Community

        1




        1










        answered Jul 22 '15 at 21:52









        williamt31williamt31

        11




        11



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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%2funix.stackexchange.com%2fquestions%2f217401%2fdebian-move-the-trash-folder-for-all-users-to-another-volume%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 check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?