[#!/fr] Capacite disque

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Yves PETRONIN
Date:  
À: script_shell_fr
Sujet: [#!/fr] Capacite disque
Merci. Mais je n'y arrive toujours pas.. Problème de débutant....et
peut-être de type de variable....ou de syntaxe ou les deux....

J'ai essayé d'incorporer la commande:

backupVolumeUsage= `df /Volumes/HD-G5-SAUVEG | grep -v Filesystem |
awk '{print $5}'`
puis
backupVolumeUsage= `df /Volumes/HD-G5-SAUVEG | grep -v Filesystem |
awk '{print int ($5)}'`

dans le test ci dessous, mais mon test ne fonctionne pas et le script
continue imperturbablement, bien que l' occupation disque retournée
par la commande ci dessus soit 68

#Checking the capacity of backup disk - If too low, exiting

capacityLimit=50

backupVolumeUsage= `df /Volumes/DISQUE | grep -v Filesystem | awk
'{print int($5)}'`

echo -n "[*]:Checking Backup disk capacity" | logger

if [ ${backupVolumeUsage} -gt {$capacityLimit}]; then
    
    echo "Backup volume has insufficient capacity! - Backup aborted !">> 
$TEMP
    cat $TEMP>>$rapport
    echo -n "[*]: BackupVolume insufficient! - Exiting" | logger
          exit 0
fi


#end of disk capacity test



_______________________________________________
archives :
http://listes.patpro.net/list/sshfr.fr.html
http://listes.patpro.net/mailman/listinfo/script_shell_fr