You are not logged in.

#1 2010-09-09 23:19:31

LeeF
Member
Registered: 2010-09-03
Posts: 31

[Resolved]Cron Syntax Issue

UPDATE: I dumped as many of the cron commands as I could and wrote a script to handle when to run the backups, you can find it here.


Hello all, I'll start off with a brief intro for myself since this is my first post. I've been using Arch Linux for about 3 years now (on my servers), and I absolutely love it, I actually just recently (past 2 weeks) started using it for my netbook(Now that was a real learning experience). It's an amazing distribution with a minimal learning curve for those who are familiar with BSD and Linux. I've only had an issue caused by Arch once, and it was pacman related due to me doing an -Syyn then a -S foobar without doing an -Syu first, but aside from that, it's been perfect. The package system is by far the best of any distro in my opinion, it makes it so easy to port and install custom packages. All I can say is thank you so much to the developers for making a distro that's specifically designed for those of us who like maximum horsepower mixed with fine grain control. I also like configuring everything by text files, it's much more precise and easier to duplicate results on multiple servers or systems, and as an open source software consultant, Arch has actually helped me be more productive in my professional life. big_smile

Anyways, the issue I'm having isn't Arch related, it's cron related. I usually only have a need for very basic cron commands, so I'm not very familiar or particularly good with cron. Here's the crontab entry:

0 0 2-31 * 1-6 /usr/bin/rsnapshot hourly; /usr/bin/rsnapshot daily

Now, it's supposed to run at, everyday at midnight, except on the first of the month and Sundays, but it doesn't. To me, the syntax looks correct, but the command fails to run at the specified times, someone care to help out a fellow Archer? (Don't know if "Archer" is the correct term for an Arch user, but I like it and I think it works well tongue)

Last edited by LeeF (2010-09-18 10:03:39)


\ˈlēf\

ArchLinux ---- Because I don't mind reaching under my penguin's skirt and twiddling about to make her behave.

Offline

#2 2010-09-09 23:32:38

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [Resolved]Cron Syntax Issue

try a different command.

I think the hourly and the daily flags might be the issue. the space more specifically
Try running some command which does not take additional parameters.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2010-09-09 23:37:46

LeeF
Member
Registered: 2010-09-03
Posts: 31

Re: [Resolved]Cron Syntax Issue

Inxsible wrote:

try a different command.

I think the hourly and the daily flags might be the issue. the space more specifically
Try running some command which does not take additional parameters.

I don't think so, if I view the cron job in webmin and click "Run Now", it executes successfully with the expected result, it also executes successfully if I issue the command directly in a shell. Also the following cron entry works correctly:

0 12 * * * /usr/bin/rsnapshot hourly

Last edited by LeeF (2010-09-09 23:46:42)


\ˈlēf\

ArchLinux ---- Because I don't mind reaching under my penguin's skirt and twiddling about to make her behave.

Offline

#4 2010-09-09 23:45:04

LeeF
Member
Registered: 2010-09-03
Posts: 31

Re: [Resolved]Cron Syntax Issue

Just for added info, here are all the commands I'm trying to get working for my backups(the yearly entry is deliberately commented out):

0 12 * * * /usr/bin/rsnapshot hourly
0 0 2-31 * 1-6 /usr/bin/rsnapshot hourly; /usr/bin/rsnapshot daily
0 0 2-31 * 0 /usr/bin/rsnapshot hourly; /usr/bin/rsnapshot daily; /usr/bin/rsnapshot weekly
0 0 1 * * /usr/bin/rsnapshot hourly; /usr/bin/rsnapshot daily; /usr/bin/rsnapshot weekly; /usr/bin/rsnapshot monthly
# @yearly /usr/bin/rsnapshot yearly

\ˈlēf\

ArchLinux ---- Because I don't mind reaching under my penguin's skirt and twiddling about to make her behave.

Offline

#5 2010-09-18 10:13:56

LeeF
Member
Registered: 2010-09-03
Posts: 31

Re: [Resolved]Cron Syntax Issue

One last update, I did try Inxsible's suggestion, but it still didn't work. Oh well, just like the rest of linux, if you can't get it done with an existing solution, roll your own. There's a link to the script I made to overcome this problem in the first post.


\ˈlēf\

ArchLinux ---- Because I don't mind reaching under my penguin's skirt and twiddling about to make her behave.

Offline

Board footer

Powered by FluxBB