他のネタ調べをしていたら、便利な機能を見つける。 Samba 3.0 ではゴミ箱機能がついているそうだ。
≪ /etc/samba/smb.conf ≫
[global]
vfs objects = recycle
[home]
recycle:repository = .recycle # ゴミ箱の PATH
#recycle:keeptree = yes # (消した物を探し難いいぞ!)
recycle:touch = yes # ゴミ箱入りで touch
recycle:versions = yes # 同名のファイルにバージョン番号を
recycle:maxsize = 10000000 # 10MB以上は、あっさり消す
recycle:exclude = *.tmp *.temp *.o *.obj
≪ ゴミ箱掃除用に ≫
# apt-get install tmpreaper # tmpwatch が改名
≪ /etc/cron.weekly/samba-recycle ≫
#!/bin/bash
for dir in /home 色々...
do
if [ -d $dir/.recycle ]; then
/usr/sbin/tmpreaper -af 168 $dir/.recycle # 168 = 7日
fi
done
fi