Voglia di Linux

avventure e soddisfazioni usando software libero

Archive for agosto, 2006

Cronjob

nessun commento

Tra le cose inutile ma belline c’è questo piccolo script. Elimina dal cestino i file cestinati due settimane fa. Editare il percorso della home, salvarlo in /etc/cron.daily e renderlo eseguibile.

su
cp cleantrash.sh /etc/cron.daily
cd /etc/cron.daily
chmod 755 cleantrash.sh
exit

#!/bin/bash

# Clean Trash 0.1
#
# Removes old files from the KDE trash folder.
# (c) 2005-2006 Bram Schoenmakers

EXPIREDATE=`date -d’14 days ago’ +%Y%m%d`
#edit path like this: /home/youraccount/.local/share/Trash
TRASHDIR=~/.local/share/Trash

cd $TRASHDIR/info

for ITEM in *.trashinfo; do
ITEMNAME=`echo “$ITEM” | sed -e ‘s/.trashinfo//’`

#extract date
TRASHDATE=`grep DeletionDate “$ITEM” |
sed -e ‘s/^.*\(….\)-\(..\)-\(..\)T.*$/\1\2\3/’`

if [ $TRASHDATE -le $EXPIREDATE ]; then
rm -rf “$TRASHDIR/files/$ITEMNAME”
rm -f “$TRASHDIR/info/$ITEM”
fi
done

In alternativa si può giocare con l’editor del crontab personale
crontab -e
i
@daily /home/tuoaccount/percorso_dello_script cleantrash.sh
esc
Z-Z

Un valore interessante è @reboot, lo script viene eseguito all’avvio. Un approfondimento per crontab , in inglese.

ste

agosto 3rd, 2006 at 12:40 pm

Postato in trucchi


Post (forse) correlati:
  • No related posts



  • Un altra regione va verso l’open-source

    nessun commento

    ste

    agosto 2nd, 2006 at 9:03 pm

    Postato in addio a windows


    Post (forse) correlati:
  • Microsoft e Linux sposi
  • Tema kde4 per Thunderbird
  • Aperto il protocollo di skype
  • apropos open-source



  • cinque cose

    nessun commento

    … che Microsoft dovrebbe imparare da Gnu/Linux.

    E sarà difficile che lo fa…

    What Vista’s developers should have done is taken a page from Linux’s playbook. In Linux and Unix, the systems were built from the ground-up with the knowledge that a system could have multiple users and that it would be connected to an untrustworthy network.

    Can Linux be hacked? Sure. Anything can be. But, it’s fundamentally harder in Linux. Even when a cracker does make it in, it’s still difficult to do significant damage without access to the root account in Linux.

    With Windows, once you’re in, it’s an order of magnitude easier to turn the box into a spambot, rip off every password in sight, and do everything up to and including making the PC completely unusable. Who needs this?

    ste

    agosto 1st, 2006 at 11:59 pm

    Postato in addio a windows


    Post (forse) correlati:
  • Linux sul portatile bis
  • Intermezzo
  • La fine di Thunderbird & Co
  • Kde4, piccola recensione