4259 links
  • Arnaud's links
  • Home
  • RSS Feed
  • Tag cloud
  • Login
search: tag:script — newest first
  • Note: Docker stop non standard software (ignoring SIGTERM)

    docker stop command send SIGTERM to pid1 inside the container to let a chance to stop gracefully (https://www.ctl.io/developers/blog/post/gracefully-stopping-docker-containers/)
    Unfortunatly some software ignore SIGTERM and need to be stopped by their own command (hello opendj)

    To do so, in the Dockerfile, in the CMD, I use a script like this :
    /thecommand/tostart/thesoftware/inbackground
    trap "/thecommand/tostop/thesoftware" SIGTERM
    while true; do sleep 1; done

    so my script is run with PID1, docker stop sends SIGTERM, my script catch (trap) the signal, and run the command to stop gracefully

    February 16, 2017 - permalink - https://links.infomee.fr/shaare/Mxx31A
    catch docker ini script signal stop trap
  • scripts/sync_to_s3.sh at master · gdelpierre/scripts

    via VG

    October 27, 2015 - permalink - https://github.com/gdelpierre/scripts/blob/master/sync_to_s3.sh
    amazon script
  • Afficher l'original d'un fichier qui provient d'un package sous debian en une commande

    à mettre dans son bashrc

    showOriginal() {

    argument = complete path to a file

    output original file content

    packageName=$(dpkg -S $1|cut -d':' -f1)
    tmpdir="/tmp/showOriginal-$packageName-$(date +%s)"
    mkdir $tmpdir
    cd $tmpir
    apt-get download $packageName > /dev/null
    dpkg -x *.deb $tmpdir
    cat ${tmpdir}$1
    cd - >/dev/null
    rm -rf $tmpdir
    }

    September 26, 2014 - permalink - https://links.infomee.fr/shaare/tdQ_tA
    bash bashrc script
  • Writing an init script for a Java application | Gustavo Straube

    [Summary, full note in Shaarli]
    Comment créer un script d'init (/etc/init.d) pour une application Java (java -jar).

    Structure du script (sh) :
    - check_status : trouve le PID de l'appli ; renvoie 0 si elle ne tourne pas.
    - start : si déjà lancée, "already started" et exit 1 ; sinon
    java -jar /path/to/application.jar >> /path/to/logfile 2>&1 &
    - stop : si arrêtée, "already stopped" et exit 1 ; sinon kill -9 $pid
    - status : "Application is started" / "stopped".
    - case "$1" in start|stop|status|restart|reload (= stop puis start), sinon usage : $0 {start|stop|restart|reload|status}.

    EDIT : la recherche de PID de l'article ne marchait pas pour moi :
    s=ps -C 'java -jar /path/to/application.jar' -o pid h
    remplacée par :
    s=$(pgrep --full 'une string unique qui identifie la command line pour lancer mon jar')

    Attention : check_status fait "return $s", donc un PID passe par le code retour (limité à 0-255) ; à corriger si on réutilise le script.

    January 2, 2014 - permalink - http://gustavostraube.wordpress.com/2009/11/05/writing-an-init-script-for-a-java-application/
    init initd jar java script
  • MySQL Database Dump Splitter

    Je me garde ça au chaud, ça peut servir

    December 7, 2013 - permalink - https://github.com/sadreck/mysqldbsplit
    mysql script
  • Backup (mysql dump) all your MySQL databases in separate files | Running with Rails - Dev Blog not only for Rails fanatics!

    Script pour backup toutes ses bases dans des fichiers séparés

    October 9, 2013 - permalink - http://dev.mensfeld.pl/2013/04/backup-mysql-dump-all-your-mysql-databases-in-separate-files/
    mysql script
  • Scripting - bash - tutoriels - PiX-Mania Wiki

    Un wiki complet à lire sur quelques outils en bash
    xargs sed cut awk grep find while for

    April 17, 2013 - permalink - http://pix-mania.dyndns.org/mediawiki/index.php/Scripting_-_bash_-_tutoriels#for
    bash script
  • Sauvegarder son site FTP automatiquement avec WinSCP
    November 4, 2012 - permalink - http://syskb.com/sauvegarder-son-site-ftp-automatiquement-avec-winscp/
    backup script winscp
  • Un "ls -rtl" récursif - LinuxFr.org
    February 9, 2012 - permalink - http://linuxfr.org/forums/programmationperl/posts/un-ls-rtl-r%C3%A9cursif
    linux ls perl script
  • Backup FTP et base de données via un script batch
    January 7, 2012 - permalink - http://www.wakdev.com/wiki/divers/73-backup-ftp-et-base-de-donnees-via-un-script-batch.html
    ftp sauvegarde script
  • Backup FTP de serveur OVH
    December 17, 2011 - permalink - http://www.dansteph.com/backupftp.php
    backup ftp script
  • Backup FTP OVH [Archives] - Forum OVH
    December 17, 2011 - permalink - http://forum.ovh.com/archive/index.php/t-9612.html
    backup ftp script