LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-07-2023, 08:01 AM   #1
narawntapu
LQ Newbie
 
Registered: Mar 2023
Posts: 1

Rep: Reputation: 0
Problem with crontab


Hello

I have a problem with crontab while trying to delete index from ElasticSearch using curator. I have a crontab schedule:
30 14 * * * curator (/usr/local/bin/curator --config /home/curator/.curator/curator.yml /home/curator/.curator/delete_apm_index.yml 2>&1) >/home/curator/.curator/log/logfile

Running the program in a console remove old index, however runing it from crontab logs the followin in /var/log/syslog:
Mar 7 14:30:01 lpavpvkibana2 CRON[178600]: (curator) CMD (curator (/usr/local/bin/curator --config /home/curator/.curator/curator.yml /home/curator/.curator/delete_apm_index.yml 2>&1) >/home/curator/.curator/log/logfile)
And the index is still in ElasticSearch. As a dummy test i created fie test and added next task in crontab:
30 14 * * * curator rm /home/curator/.curator/test >/dev/null 2>&1

After running from cron the file still exists... What am I doing wrong?
Additionally curator run from the console produce some output, but my syslog remains only single line.

I'm in stuck. Please help
Best regards
 
Old 03-19-2023, 12:55 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913Reputation: 5913
Welcome to LQ.
Where did you add the cron jobs? As a system cron job in /etc/crontab or as a user cron i.e. via crontab -e?

A system cron job requires a user but a user's cron job does not.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Problem with crontab:: command not executed properly via crontab Ankush Seth Linux - Newbie 11 11-11-2013 06:25 AM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 05:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
man crontab(5) vs crontab(1) Canis Polaris Linux - Newbie 2 06-04-2008 04:03 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration