Can't seem to setup a simple cron job

718 views
Skip to first unread message

scaramanga

unread,
Feb 7, 2013, 9:10:17 AM2/7/13
to

I'm trying to start a (not so) little rsync-based snapshot script I created via cron. I'd like it to run at 15:50 every day. Simple enough right?

I go to the cron setup page where I find 3 fields: When, At and Command.
The command part is easy: /home/<user-name>/scripts/snapshot_pc.sh

The thing is no matter what I try to put in the other two fields I end up with something weird.
I can't get crontab -l to look like this:
# crontab -l
50 15 * * * /home/<user-name>/scripts/snapshot_pc.sh

What should I input into those 2 fields?

When I add that directly to /var/spool/cron/crontabs/root and I goto that cron setup web page I see the following:
When: *
At: 15
Command: /home/<user-name>/scripts/snapshot_pc.sh
But after I press submit (without changing anything:
# crontab -l
0 15 * * * /home/<user-name>/scripts/snapshot_pc.sh

I'm running RC2 (reloaded method) on a DNS-323 HW Rev. C1.

scaramanga

unread,
Feb 7, 2013, 9:18:24 AM2/7/13
to
One more question: I noticed that I'm not "prompted" to save settings. Where does /var/spool/cron/crontabs actually reside? flash? sda2?
That aufs / mount is messing with my head :)

Edit: It's in /Alt-F/var/spool/cron/crontabs
A different question arises: Which of the two files should I edit? Does it matter?

Joao Cardoso

unread,
Feb 7, 2013, 9:55:05 AM2/7/13
to Alt-F Group


On Feb 7, 2013 2:04 PM, "scaramanga" <smur...@gmail.com> wrote:
>
>
> I'm trying to start a (not so) little rsync-based snapshot script I created via cron. I'd like it to run at 15:50 every day. Simple enough right?
>
> I go to the cron setup page where I find 3 fields: When, At and Command.
> The command part is easy: /home/<user-name>/scripts/snapshot_pc.sh
>
> The thing is no matter what I try to put in the other two fields I end up with something weird.
> I can't get crontab -l to look like this:
> # crontab -l
> 50 15 * * * /home/<user-name>/scripts/snapshot_pc.sh
>
> What should I input into those 2 fields?

what does the tooltip says?

no tooltip? what browser are you using?


>
> I'm running RC2 (reloaded method)

and dont you have trouble saving settings?

on a DNS-323 HW Rev. C1.
>

> --
> You received this message because you are subscribed to the Google Groups "Alt-F" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
> To post to this group, send email to al...@googlegroups.com.
> Visit this group at http://groups.google.com/group/alt-f?hl=en.
> To view this discussion on the web visit https://groups.google.com/d/msg/alt-f/-/uSwNG5XhkqkJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

Joao Cardoso

unread,
Feb 7, 2013, 9:57:05 AM2/7/13
to Alt-F Group


On Feb 7, 2013 2:15 PM, "scaramanga" <smur...@gmail.com> wrote:
>
> One more question: I noticed that I'm not "prompted" to save settings.

odd...

Where does /var/spool/cron/crontabs actually reside? flash? sda2?

read from flash at boot.

> That aufs / mount is messing with my head :)

yes!

>
>
> On Thursday, February 7, 2013 4:04:14 PM UTC+2, scaramanga wrote:
>>
>>
>> I'm trying to start a (not so) little rsync-based snapshot script I created via cron. I'd like it to run at 15:50 every day. Simple enough right?
>>
>> I go to the cron setup page where I find 3 fields: When, At and Command.
>> The command part is easy: /home/<user-name>/scripts/snapshot_pc.sh
>>
>> The thing is no matter what I try to put in the other two fields I end up with something weird.
>> I can't get crontab -l to look like this:
>> # crontab -l
>> 50 15 * * * /home/<user-name>/scripts/snapshot_pc.sh
>>
>> What should I input into those 2 fields?
>>

>> When I add that directly to /var/spool/cron/crontabs/root and I goto that cron setup web page I see the following:
>> When: *
>> At: 15
>> Command: /home/<user-name>/scripts/snapshot_pc.sh
>> But after I press submit (without changing anything:
>> # crontab -l
>>

>> 0 15 * * * /home/<user-name>/scripts/snapshot_pc.sh
>>

>> I'm running RC2 (reloaded method) on a DNS-323 HW Rev. C1.


>
> --
> You received this message because you are subscribed to the Google Groups "Alt-F" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
> To post to this group, send email to al...@googlegroups.com.
> Visit this group at http://groups.google.com/group/alt-f?hl=en.

> To view this discussion on the web visit https://groups.google.com/d/msg/alt-f/-/vHLukDxtHQ8J.

scaramanga

unread,
Feb 7, 2013, 10:28:47 AM2/7/13
to


On Thursday, February 7, 2013 4:55:05 PM UTC+2, Joao Cardoso wrote:


On Feb 7, 2013 2:04 PM, "scaramanga" <smur...@gmail.com> wrote:
>
>
> I'm trying to start a (not so) little rsync-based snapshot script I created via cron. I'd like it to run at 15:50 every day. Simple enough right?
>
> I go to the cron setup page where I find 3 fields: When, At and Command.
> The command part is easy: /home/<user-name>/scripts/snapshot_pc.sh
>
> The thing is no matter what I try to put in the other two fields I end up with something weird.
> I can't get crontab -l to look like this:
> # crontab -l
> 50 15 * * * /home/<user-name>/scripts/snapshot_pc.sh
>
> What should I input into those 2 fields?

what does the tooltip says?

It says that At should be hour of the day 0..23. So if I understand correctly I can't use it to set cron jobs at a certain time? That's a bummer, man.
I see where you're going with this, trying to make it user-friendly. But I think it might be better to either use 5 different text input boxes or just a big one. The syntax might be a bit cryptic to most, but it can be solved by a bit of reading/help.
The way it is now, it's a bit of a dumbed-down version of a crontab front-end. Can yo do things like every 2 hours (* */2 * * *), for example?

no tooltip? what browser are you using?

I'm using Firefox 19 (beta channel, up to date).

>
> I'm running RC2 (reloaded method)

and dont you have trouble saving settings?

Nothing I noticed so far, no, besides the hostname bug where after each reboot I need to hit submit and the mount options not being respected (I reported that already).

on a DNS-323 HW Rev. C1.
>

(I'm trying to merge those two discussions into this one thread)
 
> One more question: I noticed that I'm not "prompted" to save settings.

odd...

Where does /var/spool/cron/crontabs actually reside? flash? sda2?

read from flash at boot.

> That aufs / mount is messing with my head :)

yes!

 Now I'm really confused. I thought /var/spool/cron/crontabls is located in /mnt/sda2/Alt-F/var/spool/cron/crontabs/, and it's OK that it isn't listed in the files that have changed.

Joao Cardoso

unread,
Feb 7, 2013, 12:00:12 PM2/7/13
to al...@googlegroups.com


On Thursday, February 7, 2013 2:15:54 PM UTC, scaramanga wrote:
One more question: I noticed that I'm not "prompted" to save settings. Where does /var/spool/cron/crontabs actually reside? flash? sda2?

That aufs / mount is messing with my head :)

Edit: It's in /Alt-F/var/spool/cron/crontabs

Everything found under /Alt-F that also exists under / shadows it. So, /Alt-F/var/spool/cron/crontabs is what you see/use/edit, shadowing /var/spool/cron/crontabs

A different question arises: Which of the two files should I edit? Does it matter?

The README that you found under /Alt-F says:

DONT'T ADD, REMOVE OR CHANGE ANY FILE ON THIS DIRECTORY
OR IN ANY OF ITS SUBDIRECTORIES, OR THE SYSTEM MIGHT HANG.

If you really need to do that, use 'aufs.sh -n' first.

Type 'aufs.sh' alone to get its usage.
The default is to be used in 'reval' mode, faster than the 'notify' mode, but that does not sees changes directly made under /Alt-F.

Joao Cardoso

unread,
Feb 7, 2013, 12:32:09 PM2/7/13
to al...@googlegroups.com

> What should I input into those 2 fields?

what does the tooltip says?

It says that At should be hour of the day 0..23. So if I understand correctly I can't use it to set cron jobs at a certain time? That's a bummer, man.

I see where you're going with this, trying to make it user-friendly. But I think it might be better to either use 5 different text input boxes or just a big one. The syntax might be a bit cryptic to most, but it can be solved by a bit of reading/help.
The way it is now, it's a bit of a dumbed-down version of a crontab front-end. Can yo do things like every 2 hours (* */2 * * *), for example?

You are one of the 10%.
Use the command line to use crontab at your will, and then *don't* use the crontab UI.

The values you enter in each field should be put verbatim (but didn't test it now) in the days and hours of the crontab file; if you want the hours field to be /2, just enter it (not sure if the '/' will not mess up some sed/grep/whatever).

I'm not even sure if busybox cron accepts all options of the usual syntax.

For RC3 hour, hour[:min] and :min will be allowed in the hour field, and [d]day will specify day of the month.


no tooltip? what browser are you using?

I'm using Firefox 19 (beta channel, up to date).

>


> I'm running RC2 (reloaded method)

and dont you have trouble saving settings?

Nothing I noticed so far, no, besides the hostname bug where after each reboot I need to hit submit and the mount options not being respected (I reported that already).

on a DNS-323 HW Rev. C1.
>

(I'm trying to merge those two discussions into this one thread)

Too late...
 
 
> One more question: I noticed that I'm not "prompted" to save settings.

odd...

Where does /var/spool/cron/crontabs actually reside? flash? sda2?

read from flash at boot.

> That aufs / mount is messing with my head :)

yes!

 Now I'm really confused. I thought /var/spool/cron/crontabls is located in /mnt/sda2/Alt-F/var/spool/cron/crontabs/, and it's OK that it isn't listed in the files that have changed.

Read my previous post.
The system utilities only knows /var/spool/cron/crontabls. It might be there by itself,  be there and also under Alt-F (which shadows the original one), or only under /Alt-F (but appearing as /var/spoo...)

The following is from RC3 but similar to yours, start reading from the bottom

# aufs.sh -l
...
/mnt/sda4/Alt-F=rw # third floor, if file/dir present here shadows the one in the second floor 
/rootmnt/rw=rw # second floor, if file/dir present here shadows the one in the first floor (no COW, as it is writable)
/rootmnt/ro=rr # first floor, original from flash, read only. If file is modified, it is first copied to the second floor (COW -- copy on write)

first and second floor at setup by the /init script at boot time. Third floor setup when the first 'Alt-F' named directory is found at filesystem automount.
Rules for creation, deletion and modification of files and directories are different.

/Alt-F is a link to the first 'Alt-F' directory found at any filesystem root.

Got it?
Not simple, confusing and can lead to pathological problems. That's why union filesystems was not accepted for inclusion in the linux kernel (only union mounts was)

scaramanga

unread,
Feb 7, 2013, 1:17:54 PM2/7/13
to al...@googlegroups.com


On Thursday, February 7, 2013 7:32:09 PM UTC+2, Joao Cardoso wrote:

> What should I input into those 2 fields?

what does the tooltip says?

It says that At should be hour of the day 0..23. So if I understand correctly I can't use it to set cron jobs at a certain time? That's a bummer, man.
I see where you're going with this, trying to make it user-friendly. But I think it might be better to either use 5 different text input boxes or just a big one. The syntax might be a bit cryptic to most, but it can be solved by a bit of reading/help.
The way it is now, it's a bit of a dumbed-down version of a crontab front-end. Can yo do things like every 2 hours (* */2 * * *), for example?

You are one of the 10%.
You know how to flatter a guy, I can give you that.
Use the command line to use crontab at your will, and then *don't* use the crontab UI.
Yup, that's what I'm doing at the moment. I should've addad that the motivation for using  non-whole hour goes all the way back from my ffp days, where I didn't want it to conflict with other system time-keeping cron jobs. I actually ran into a bizarre  problem where because of the time drift fix cron job I ended up with two backups starting at the same time. I wrote about it here: http://forum.dsmg600.info/viewtopic.php?pid=46934#p46934
This is also to make sure none of my cron jobs run concurrently (I had hourly watch-dog type of jobs) as this NAS is a bit under-powered.

The values you enter in each field should be put verbatim (but didn't test it now) in the days and hours of the crontab file; if you want the hours field to be /2, just enter it (not sure if the '/' will not mess up some sed/grep/whatever).

I'm not even sure if busybox cron accepts all options of the usual syntax.
I had a cron job running with the following schedule (13 */2 * * *) in the good-ol' ffp 0.5 days, so I think the answer is probably yes.

For RC3 hour, hour[:min] and :min will be allowed in the hour field, and [d]day will specify day of the month.
Good news, looking forward for this.


no tooltip? what browser are you using?

I'm using Firefox 19 (beta channel, up to date).

>
> I'm running RC2 (reloaded method)

and dont you have trouble saving settings?

Nothing I noticed so far, no, besides the hostname bug where after each reboot I need to hit submit and the mount options not being respected (I reported that already).

on a DNS-323 HW Rev. C1.
>

(I'm trying to merge those two discussions into this one thread)

Too late...
lolz. google groups isn't very good at this mutiple-discussions-single-topic thing.
 
 
> One more question: I noticed that I'm not "prompted" to save settings.

odd...

Where does /var/spool/cron/crontabs actually reside? flash? sda2?

read from flash at boot.

> That aufs / mount is messing with my head :)

yes!

 Now I'm really confused. I thought /var/spool/cron/crontabls is located in /mnt/sda2/Alt-F/var/spool/cron/crontabs/, and it's OK that it isn't listed in the files that have changed.

Read my previous post.
The system utilities only knows /var/spool/cron/crontabls. It might be there by itself,  be there and also under Alt-F (which shadows the original one), or only under /Alt-F (but appearing as /var/spoo...)

The following is from RC3 but similar to yours, start reading from the bottom

# aufs.sh -l
...
/mnt/sda4/Alt-F=rw # third floor, if file/dir present here shadows the one in the second floor 
/rootmnt/rw=rw # second floor, if file/dir present here shadows the one in the first floor (no COW, as it is writable)
/rootmnt/ro=rr # first floor, original from flash, read only. If file is modified, it is first copied to the second floor (COW -- copy on write)

first and second floor at setup by the /init script at boot time. Third floor setup when the first 'Alt-F' named directory is found at filesystem automount.
Rules for creation, deletion and modification of files and directories are different.

/Alt-F is a link to the first 'Alt-F' directory found at any filesystem root.

Got it?
Not simple, confusing and can lead to pathological problems. That's why union filesystems was not accepted for inclusion in the linux kernel (only union mounts was)


So it's OK it's not listed in the files that have changed. That's what threw me off, I misunderstood something you wrote earlier.
All's good here.

Joao Cardoso

unread,
Feb 7, 2013, 3:55:32 PM2/7/13
to al...@googlegroups.com


On Thursday, February 7, 2013 6:17:54 PM UTC, scaramanga wrote:


On Thursday, February 7, 2013 7:32:09 PM UTC+2, Joao Cardoso wrote:

> What should I input into those 2 fields?

what does the tooltip says?

It says that At should be hour of the day 0..23. So if I understand correctly I can't use it to set cron jobs at a certain time? That's a bummer, man.
I see where you're going with this, trying to make it user-friendly. But I think it might be better to either use 5 different text input boxes or just a big one. The syntax might be a bit cryptic to most, but it can be solved by a bit of reading/help.
The way it is now, it's a bit of a dumbed-down version of a crontab front-end. Can yo do things like every 2 hours (* */2 * * *), for example?

You are one of the 10%.
You know how to flatter a guy, I can give you that.

No sarcasm intended. I want to mean that you are one of the 10% that don't need a UI, not one of the "other" 10% (or you wouldn't have a DNS-323, would you?)


scaramanga

unread,
Feb 7, 2013, 4:28:37 PM2/7/13
to al...@googlegroups.com
I didn't think you're sarcastic. Plenty of people around here are a bit more *nix literate than most. And you're right, I got the DNS-323 because of its habitability. Nowadays it's a huge plus that guides many of my purchases (got an Asus RT-N16 flashed with Tomato - but that's for another forum).
p.s.: ... and I made a mistake. Once every two hours, on the hour, should be 0 */2 * * *. What I wrote before would run every minute one hour and then wait for an hour before running every minute the hour after.
Reply all
Reply to author
Forward
0 new messages