Cron Jobs / Crontab - Cannot Create or Edit File

aaronesteban

New Member
Joined
Oct 6, 2020
Messages
1
Reaction score
0
Credits
20
I try to edit the crontab file to create con jobs by using ssh "sudo crontab -e" and "crontab -e", but I keep getting the following error message (or as shown in the image below):

no crontab for root - using an empty one
crontab: installing new crontab
"/tmp/crontab.C7Hy04/crontab":22: bad minute
errors in crontab file, can't install.


cant-edit-crontab-file.png


And the file path location "/var/spool/cron/crontabs/" folder is empty. Shouldn't there be a cron file of some type to edit?

So what I'm trying to do is create cron jobs to handle my Mautic cron tasks/jobs as shown below:

php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:segments:update
php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:campaigns:update
php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:campaigns:trigger
php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:iplookup:download
php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:broadcasts:send
php /var/www/aaronsnewsletters.com/public_html/bin/console mautic:maintenance:cleanup --days-old=60 --no-interaction


Do I need to somehow reinstall the crontab setup or how do I get back to being able to edit with nano? At this point I'm not able to edit the main crontab file & nor do I know where it is located.

Thanks for any support.
 


When you do crontab -e the following location gets edited: /var/spool/cron/$USER. If the format is wrong crontab will notify you and ask you if you want to edit cront to correct the mistake. The format it wants looks like this:
# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
 
Last edited:

Members online


Latest posts

Top