Как только у вас есть сценарий, который делает то, что вы хотите, добавьте его в таблицу cron (или crontab
), и задание будет выполняться с той частотой, которую вы хотите. Итак:
#!/bin/bash
if ! [[ -z $(find /path/to/file -mmin 60) ]]; then
# The file was changed, so:
echo -e "The hash is:\n$(md5sum /path/to/file)" | mail -s "/file has changed on $(hostname -s) username@example.com"
else
# If this is in the crontab, remove this else stanza; cron
# jobs should not write to standard output, lest that output
# be sent to the local mailer daemon to drop it into the owner's
# mailbox.
echo "No changes to /path/to/file detected."
fi
Tengo el mismo problema cuando Emacs PATH no copia el contenido del shell de inicio de sesión. Ejecuto esto en el búfer de Emacs *scratch *:
(getenv "PATH")
"/usr/bin:/bin:/usr/sbin:/sbin"
(Alternativamente, presione M-x
y escriba getenv
, luego escriba PATH
.)
Busqué la ubicación de pdflatex
en un shell de inicio de sesión en Terminal con:
> which pdflatex
/Library/TeX/texbin/pdflatex
Así que agregué ese directorio a la RUTA, p. agregue esto a.emacs
:
(setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin"))
y vuelva a buscarlo con M-x load-file
y escriba ~/.emacs
. Y ahora C-c C-e lp
en modo Org -funciona:
PDF file produced.
(Cross -publicado en StackOverlow .)