Skip to content

Instantly share code, notes, and snippets.

@vovs03
Last active November 7, 2018 10:11
Show Gist options
  • Save vovs03/b018812b85eefae6ee2be27a574787be to your computer and use it in GitHub Desktop.
Save vovs03/b018812b85eefae6ee2be27a574787be to your computer and use it in GitHub Desktop.
Cron + Postfix in DEB-systems

Cron

Note from 2018-11-07 08:55:23.489

crontab -u keyjoo -e

// add command 50 7 * * * keyjoo /bin/bash ~/code/scripts/hi.sh

Google
how to see crontab log in linux
https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log

/var/log/syslog

grep CRON /var/log/syslog
tail -f /var/log/syslog | grep CRON

Error:
Nov 7 09:00:01 osart-011 CRON[11205]: (CRON) info (No MTA installed, discarding output)

Need install MTA Mail Transfer Agent

g
https://askubuntu.com/questions/222512/cron-info-no-mta-installed-discarding-output-error-in-the-syslog
sudo apt-get install postfix

#!/bin/bash
# 2018-11-07 12:11
# Author: Vladimir Pavlychev <[email protected]>
# Script: <https://github.com/KeyJoo>
###############################################################################
# Need include this script to -cron- #
# Task: #
# https://ru.stackoverflow.com/questions/799266/Запуск-firefox-из-crontab #
###############################################################################
## Steps:
# 0. Read manual or tutorial:
# `man crontab`
# http://bit.ly/2018-cron-in-ubuntu-
# 1. Open terminal and check it (List crontab):
# `crontab -l`
# 2. Save this script to /etc/cron.daily/firefox-run.sh
# http://bit.ly/2zy4t4Y
export DISPLAY=:0
xhost localhost
clear
/usr/bin/firefox -new-window "https://ru.stackoverflow.com/users/235107/keyjoo"
sleep 1.5
# 3. Add task to crontab:
# crontab -u <user> -e
# Edit your user crontab
# Also you can see also my gist here: http://bit.ly/2zuxka0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment