Trovar lavoro col cron 8^)




Ghaghaghaghagah... quando la malattia vige tutto e' + malsano, quindi + bello :)

Un mio personale scriptino per tutti coloro che cercano lavoro, a voi il compito di capire cosa fa (nulla di difficile, pure korn-shell-programming :)




#!/bin/ksh

# make your customizations here

URL="http://lavoro.annunci.tiscali.it/palermo/lavoro/offerte/qualificato/index.html"
WGET="/opt/sfw/bin/wget"
WOPT="--proxy=on"
ERR="err.log"
DIR="$HOME/.autojob"
NODIFF="no.log"
SBJ="New job!"
MSG="Check $URL ! Maybe there's a job 4 u...!"

if [[ ! -d $DIR ]] then
    echo "So... your first time with autojob, ya ?"
    echo "Create .autojob directory pliz..."
    exit
fi

if [[ -a $DIR/index.html ]] then
    mv $DIR/index.html $DIR/index.html.old
fi

cd $DIR && $WGET $WOPT $URL 1>/dev/null 2>$DIR/$ERR && \
    diff $DIR/index.html $DIR/index.html.old > /dev/null && touch $NODIFF

if [[ -a $DIR/$NODIFF ]] then
    rm $DIR/$NODIFF
    exit
else

    echo $MSG | mailx -s $SBJ $USER
fi



salvatelo con nome autojob (x esempio) e mettetelo in /usr/local/bin (ad esempio)
editate il vostro crontab ( crontab -e )inserendo:

00 * * * 1-5 /usr/local/bin/autojob



buon divertimento e... in culo alla balena !


by darko