Struggling to control access to a server using cron[SOLVED]

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

Struggling to control access to a server using cron[SOLVED]

#1 Post by paulh177 »

I have the abyss webserver (very neat -- can someone update the .pet to the latest version pls?) running on puppy 3.0.
The idea is to make some large photo albums available to friends.
My ISP provides lots of bandwidth between 00:00 and 16:00 and little between 16:00 and 00:00.
I want to exclude access between the latter times for obvious reasons.
Ideally I'd have the port on which abyss is running closed during that time but my router is not sophisticated enough to do that.
I have iptables set up (via wizard -- i'm not clever enough to understand how to manually craft it) with all ports except that one closed.
So I think that the only way I am going to be able to do this is to start abyssws on boot then run a cron job to kill it at 16:00 every day.
Or is there way to have a script that will reconfigure iptables "on the fly" and use cron to control that?
Or is there a "better" solution that someone knows of?

thanks

paul
Last edited by paulh177 on Thu 01 Nov 2007, 07:55, edited 2 times in total.

User avatar
cb88
Posts: 1165
Joined: Mon 29 Jan 2007, 03:12
Location: USA
Contact:

#2 Post by cb88 »

Pschedule is a frontend to cron that is easier to use than gcrontab...here is the link maybe it will help you get started.. http://www.murga-linux.com/puppy/viewto ... 1530290542

zigbert is pretty open to sugestions if you can think of ideas how to make his programs better
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#3 Post by paulh177 »

thanks, looks good.
I'm not sure if crond runs by default in puppy but I can't see it in a ps so I'm assuming i can to set it to start in rc.local?

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#4 Post by paulh177 »

I'm struggling to make cron work. I've looked at the various threads where others have also struggled with the same problem, but ...

I've put

Code: Select all

 /usr/sbin/crond -L /tmp/cronjobs.log
into rc.local

ps shows crond as running after a reboot

I've setup cron jobs using Pschedule and/or Gcrontab and they are sitting happily in the file /var/spool/cron/crontabs/root. It doesn't seem to contain tabs.

To test I've got a little script which echoes a few characters to file in /root ... but it is not being executed and i've even remembered to set it executable.

My cronjobs.log file contains nothing except a line indicating crond has started.

/var/log/messages also notes crond starting up but I also noticed that the kernel timestamps were different from my local time so I reset the time in puppy (it was set to perth not london)

Dunno what else to try/check ...

paul

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#5 Post by paulh177 »

i finally got cron working satisfactorily; i opened /var/spool/cron/crontabs/root with e3vi and found what appeared to be an "extra" character at the end of the file; removing this and saving the file seemed to cause cron to spring into life.

Post Reply