4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
    Type 1 or more characters for results.
    Links per page: 20 50 100
    page 1 / 1
    4 results tagged crontab x
    • thumbnail
      quoting - How can I execute `date` inside of a cron tab job? - Unix & Linux Stack Exchange

      The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. Percent-signs (%) in the command, unless escaped with backslash (), will be changed into newline charac- ters, and all data after the first % will be sent to the command as standard input.

      16 février 2016 à 10:44:30 UTC+1 - permalink - archive.org - http://unix.stackexchange.com/questions/29578/how-can-i-execute-date-inside-of-a-cron-tab-job
      cron crontab date escape
    • Comment filtrer la sortie d'erreur (seulement)

      Prenons un bash qui ouput sur sa sortie standard (stdout) et sur sa sortie d'erreur (stderr) :

      cat test.bash

      echo good
      echo bad >&2
      echo vanish >&2
      echo good!

      Comment faire pour rediriger la sortie standard vers un fichier (ou /dev/null pour l'exemple) et filter la sortie d'erreur pour retirer la ligne "vanish" ?

      Pour ça il faut utiliser un process substitution :

      /root/test.bash 2> >(grep -v vanish >&2) >/dev/null

      Bien pratique dans un crontab pour recevoir un peu moins de mail lorsqu'on a des "erreurs" acceptables (rsync vanished par exemple)

      SHELL=/bin/bash

              • root /root/test.bash 2> >(grep -v vanish >&2) >/dev/null

      Pour en savoir plus sur les process substitution : http://tldp.org/LDP/abs/html/process-sub.html

      7 novembre 2014 à 10:16:11 UTC+1 - permalink - archive.org - https://links.infomee.fr/?-D0dqQ
      cron crontab indirection redirection rsync stderr stdin vanish
    • Crontab Redirect to Log File With Date in Name

      Bon à savoir, pour rediriger la sortie standard d'un cron dans un fichier avec la date, penser à échapper les "%"

      /path/to/log/dir/$(date +\%Y-\%m-\%d).log

      30 octobre 2014 à 11:15:06 UTC+1 - permalink - archive.org - http://www.idevelopment.info/data/Oracle/DBA_tips/Unix/UNIX_7.shtml
      cron crontab log logs
    • Elegantly dropping priviledge in an /etc/cron.daily script » Mike / Michael Fogel

      A mettre au début d'un script qui se trouve dans un des dossiers /etc/cron.xxxx pour qu'il soit éxécuté par un utilisateur autre que root.

      !/bin/sh

      USER='some-low-privilege-user'
      if [ whoami != "$USER" ]; then
      sudo -u $USER "$0"
      exit
      fi

      ... rest of the script ...

      9 décembre 2013 à 22:28:22 UTC+1 - permalink - archive.org - http://www.fogel.ca/2010/08/07/elegantly-dropping-priviledge-in-an-etccron-daily-script/
      crontab debian linux
    Links per page: 20 50 100
    page 1 / 1
    Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation