A
A
ASPI2014-09-02 12:13:02
linux
ASPI, 2014-09-02 12:13:02

Why is the file always empty when sending a text file (as an attachment or in the body of the letter, it doesn't matter) by cron?

If you execute the cron -
What is an empty letter coming in? What is an empty file in an attachment coming in this way. And if you just execute in the console, everything comes as it should, what is an attachment in the body of the letter. For reference -
mail -s "new list" mail@domen < list.txt
mpack -s "new list" list.txt mail@domen

# echo $SHELL
/bin/bash
# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:        12.04
Codename:       precise

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin, 2014-09-02
@ASPI

Specify the full path to the list.txt file

V
Vlad Zhivotnev, 2014-09-02
@inkvizitor68sl

First, everything is run from the cron from under sh.
Secondly, write full paths to files (and better - binaries too, or set $PATH explicitly).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question