Article

"-":4: bad minute when installing crontab from a file

I recently had to migrate a rather messy crontab from one server to another and to try and simplify things I wanted to split the crontab into managable chunks.  

Unfortunately the crontab does not have any import / include functionality and I didn't want to use different user accounts to have different crontabs (this would likely cause permission issues, a management headache, and I would be replacing one messy solution with another) so after a quick Google I found that the solution was to create the separate files and concatentate them into the crontab. i.e.

cat site1.cron site2.cron | crontab

However, when I tried this I got presented with:-

[[email protected] crontab]$ cat site1.cron site2.cron  | crontab
"-":4: bad minute
errors in crontab file, can't install.

As I was updating the site1.cron and site2.cron files using Windows I was running into issues with differences in line ending between Windows and Linux, so to resolve this simply run it through dos2unix first i.e.

cat site1.cron site2.cron | dos2unix | crontab

Now the crontab installs perfectly and no more bad minute error message.

me.jpeg

I am a web developer specialising in web driven applications using PHP, MySQL, Symfony and Zend and I am currently working for the The Drum in Glasgow, Scotland.

Most days I can be found frantically coding away with EuroDance in my ears and consuming what I hope to be a never ending supply of coffee... happy days!

Chris's Reading List

Medium

Medium

How a single change boosted organic traffic by 40%

How a single change boosted organic traffic by 40%

The SEO world can sometimes be a confusing maze of contradictions. Read more

verraes.net

verraes.net

Sensible Interfaces

Sensible Interfaces

How did we get from 'Program to an interface, not to an implementation' to 'Just slap an interface on there, it's the fashionable thing to do'? Read more

Moz

Moz

The Linkbait Bump: How Viral Content Creates Long-Term Lift in Organic Traffic - Whiteboard Friday

The Linkbait Bump: How Viral Content Creates Long-Term Lift in Organic Traffic - Whiteboard Friday

A fantastic piece of content can lift your traffic curves to a "new normal." In today's Whiteboard Friday, Rand talks about exactly how that happens, and how you can create content that has that effect. Read more

Loige

Loige

6 Rules of thumb to build blazing fast web applications (server side)

6 Rules of thumb to build blazing fast web applications (server side)

In this post are described 6 extremely important rules you should take under consideration when writing your next web application Read more

SitePoint

SitePoint

Console Wars - PHP CLI Libraries

Console Wars - PHP CLI Libraries

Nicola Pietroluongo compares three popular PHP console libraries, building the same functionality in each. Wondering which one is right for you? Find out! Read more

TechCrunch

TechCrunch

Servers.com Brings Its Bare-Metal Servers To The US

Servers.com Brings Its Bare-Metal Servers To The US

Servers.com, a hosting company with a focus on dedicated bare-metal servers that launched in Europe in 2005, today announced the opening of its first U.S... Read more

Advertisement

Digital Ocean