Line 44: |
Line 44: |
| === Automatic Cleaning Of Recycle Bin Content === | | === Automatic Cleaning Of Recycle Bin Content === |
| | | |
− | The simple script below can be used to clean out the various Recycle Bins on a regular basis. Note that this script is setup to use the last accessed file attribute to selectively deletes files after they have been in the Recycle Bin for 30 days. | + | The simple script below can be used to clean out the various Recycle Bins on a regular basis. |
| + | |
| + | Note that this script is setup to use the last changed file attribute to selectively deletes files after they have been in the Recycle Bin for 30 days. |
| | | |
| Setup the script to run either daily or weekly from cron. | | Setup the script to run either daily or weekly from cron. |
Line 50: |
Line 52: |
| <pre> | | <pre> |
| #!/bin/bash | | #!/bin/bash |
| + | |
| + | # ensure finds includes hidden files in the Recycle Bins |
| + | shopt -s dotglob |
| | | |
| echo "+------------------------------------------------------------------------------+" | | echo "+------------------------------------------------------------------------------+" |
Line 55: |
Line 60: |
| echo "+------------------------------------------------------------------------------+" | | echo "+------------------------------------------------------------------------------+" |
| | | |
− | URF=$(find /home/e-smith/files/users/*/home/Recycle\ Bin/* -type f -atime +30) | + | URF=$(find /home/e-smith/files/users/*/home/Recycle\ Bin/* -type f -ctime +30) |
| if [ "$URF" != "" ] | | if [ "$URF" != "" ] |
| then | | then |
Line 71: |
Line 76: |
| echo "+------------------------------------------------------------------------------+" | | echo "+------------------------------------------------------------------------------+" |
| | | |
− | IRF=$(find /home/e-smith/files/ibays/*/files/Recycle\ Bin/* -type f -atime +30) | + | IRF=$(find /home/e-smith/files/ibays/*/files/Recycle\ Bin/* -type f -ctime +30) |
| if [ "$IRF" != "" ] | | if [ "$IRF" != "" ] |
| then | | then |