Koozali.org: home of the SME Server

Recyclebin - Pulizia periodica

Offline nicolatiana

  • *
  • 724
  • +0/-0
Recyclebin - Pulizia periodica
« on: May 20, 2008, 12:20:14 AM »
Prima di fare delle stupidaggini: mi sono creato uno script per ripulire periodicamente il cestino sia degli utenti che delle ibay. Mi sembra che funzioni ma se qualcuno più esperto butta un occhio non mi dispiace  :D.

Saluti e grazie in anticipo

Nicola

######################################################################################
#
# Script location: /etc/cron.daily/samba-recyclebin
#
# Recyclebin folder = .Cestino
# Purge files/folders older than 14 days
#
#!/bin/bash
#
######################################################################################

# -------------------------------------------
# User home directories section - Purge files
# -------------------------------------------

 find /home/e-smith/files/users/*/home/.Cestino -mtime +14 -type f -exec rm -r {} \;

# ----------------------------------------------------
# User home directories section - Delete empty folders
# ----------------------------------------------------

 find /home/e-smith/files/users/*/home/.Cestino -mtime +14 -type d -empty -exec rm -r {} \;

# ---------------------------------------
# iBays directories section - Purge files
# ---------------------------------------

find /home/e-smith/files/ibays/*/files/.Cestino -mtime +14 -type f -exec rm -r {} \;

# -------------------------------------------------
# iBays directories section - Delete empty folders
# -------------------------------------------------

find /home/e-smith/files/ibays/*/files/.Cestino -mtime +14 -type d -empty -exec rm -r {} \;
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.