Comments (2)
Originally from http://code.google.com/p/greyhole/issues/detail?id=46
from greyhole.
I do that now via shell scripts... here is a copy of a shell script which manages one of my shares which basically is for television programming I watch and delete. The "DAYS" variable will determine the retention time and the "DIR" variable is the path to the recycle bin folder and subtree that I want to target. The "SAVEIFS" and "IFS" variable is to reset the delimeter on the shell so I can handle file names with spaces.
I write the script operation to a custom log file on the hard drive and also do a check to see if something is stuck in the recycle bin because that actually happened to me once where a bunch of files were orphaned and since Greyhole does not run fsck against the recycle bin they just sat there until I noticed that my script was trying to delete them every day for the last 3 months. This script is run at 4 AM every day in cron.
#!/bin/bash
DAYS=21
DIR="/home/bergang/trash_gh/TV_no_backup"
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
DATE=`date "+%b %d %T"`
GS=`greyhole -s |grep 'Total:' | awk '{print$8}'`
echo "$DATE : cleanup_gh_trash_tvnb.sh" >> /custom_logs/gh_attic_mtce.log
echo ": Starting Attic Size $GS" >> /custom_logs/gh_attic_mtce.log
for delete in `find $DIR/* -atime +$DAYS `
do
echo " : Deleting : $delete" >> /custom_logs/gh_attic_mtce.log
rm -rf "$delete"
done
for deleted in `find $DIR -type d -empty`
do
echo " : Deleting Empty Directory : $deleted" >> /custom_logs/gh_attic_mtce.log
rm -rf "$deleted"
done
let DAYS=DAYS+4
for stuck in `find $DIR/* -atime +$DAYS `
do
echo " : **** : $stuck appears to be stuck" >> /custom_logs/gh_attic_mtce.log
done
sleep 60
GS=`greyhole -s |grep 'Total:' | awk '{print$8}'`
echo ": Ending Attic Size $GS" >> /custom_logs/gh_attic_mtce.log
IFS=$SAVEIFS
from greyhole.
Related Issues (20)
- MySQL server has gone away HOT 2
- No access to files from shares. HOT 11
- Change fsck cron timing HOT 1
- Debian 12, samba 4.17 and VFS not building HOT 2
- VFS errors HOT 9
- logrotate is already installed HOT 6
- daemon: Greyhole VFS module warning HOT 2
- Greyhole won't start after update - SQL error Can't DROP 'uniqness'; HOT 4
- Makefile error Samba 4.18.6 HOT 5
- DEBUG read_smb_spool: Directory created: / WARN read_smb_spool: Failed to create directory HOT 1
- Can't add drive to drive selection group! HOT 16
- Ownership of share-folders inside gh folder HOT 6
- Accidentally Copied Lots of Small Files - Recovering from a Blown Out log and Spool. HOT 5
- fsck parallelism HOT 1
- Failed file copy (using rename) HOT 3
- No Files shown after reinstall Greyhole HOT 10
- Greyhole won't start HOT 5
- greyhole service won't start with containerd mariadb (greyhole.service) HOT 1
- Feature Request: Make Read_Smb_Spool a separate task running concurrent HOT 7
- Balance Seems to Ignore Available Drive HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greyhole.