I have a question, i'm working with crontab and generated some tasks that works fine...!! but I need to know if exists a way to keep the crontab notification in an especific file, now I sending this notification to my email, but I need this notification on an file into a local location on mi linux sever.

I hope you can help me..... thanks in advance... :)

Best Regards, VerĂ³nica.

EDIT: Heres the code of my crontab

MAILTO= verofairy@hotmail.com
HOME=/var/miuser/bin

30 * * * * rm mapVero

0 * * * * ./dspace import -a -e user@domain.user -c 123456789/0001 -s /home/PRUEBA -m mapVero

In addition the result of the command ./dspace is sent succesfully to mi email.

link|improve this question
Could you please post a code snippet which you're using to send notification to email? – quanta Oct 13 '11 at 3:07
feedback

2 Answers

Try this:

0 * * * * ./dspace option1 option2 ... > /tmp/dspace.log 2>&1

http://tldp.org/LDP/abs/html/io-redirection.html

  • 2>&1 means that redirects stderr to stdout
  • > /tmp/dspace.log 2>&1: insert both stdout and stderr to the file dspace.log (use >> /tmp/dspace.log if you want to append)
link|improve this answer
This answer it way better than mine so I would recommend this one over what I have stated. – enterzero Oct 13 '11 at 4:47
feedback

You could just use a redirect operator to output what you are after to a file on the server.

Hope this helps

link|improve this answer
Excuse me... but I'm really newbie on Linux, can you help me with an example...?? – verofairy Oct 13 '11 at 3:54
Here is a simple example, on your Linux prompt type ls > list.txt. What this will do is take the output of the LS command and put it into a txt file. So if you have a read though the page I linked it will go into more details on what you can do. – enterzero Oct 13 '11 at 4:18
To make things a bit easier for you you could try something like this 0 * * * * ./dspace import -a -e user@domain.user -c 123456789/0001 -s /home/PRUEBA -m mapVero > /home/<youruser>/log.txt. – enterzero Oct 13 '11 at 4:24
Thank you so much enterzero ..!!! ;) – verofairy Oct 13 '11 at 5:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.