How to set a cron job?
How to set a cron job?
I have my scripts ready. They're in /usr/local/bin. They're executable. I've tested them.
But I can't seem to get the cron job to work.
Since Puppy has no vi, crontab -e doesn't work.
I'm trying to use Gcrontab, but I'm not sure how it works.
This page is no help: http://www.arquired.es/users/aldelgado/proy/gcrontab/
And I have yet to find any explanation of how to make the cron jobs work.
Does anybody have a tutorial or any kind of documentation for Gcrontab?
But I can't seem to get the cron job to work.
Since Puppy has no vi, crontab -e doesn't work.
I'm trying to use Gcrontab, but I'm not sure how it works.
This page is no help: http://www.arquired.es/users/aldelgado/proy/gcrontab/
And I have yet to find any explanation of how to make the cron jobs work.
Does anybody have a tutorial or any kind of documentation for Gcrontab?
Here might help
trapster
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Maine, USA
Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
zigberts Pschedule seems a lot more intuitive than gcrontab. Here is the thread where you can get it:
http://www.murga-linux.com/puppy/viewtopic.php?t=22166
http://www.murga-linux.com/puppy/viewtopic.php?t=22166
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
As a thread of mine got namechecked, I'll summarise what I did:
But it's worth a try if yours doesn't work.
The time/date/timezone thing is really important, because otherwise cron might be working but isn't on the same clock as you (!).
As an example, I had the wrong time/TZ set on a gentoo system; I was building it using cron to schedule an emerge; cron triggered a massive download when I wasn't expecting it and I ended using a great lump of my broadband account's download limit in one hit ...
Getting something like this to work when you're struggling means taking a stepwise approach, changing only one thing at a time, and testing after each change. I say that because I'm crap at doing just that and go in scattergun too often, but it's rarely an effective approach, and if it does fix something, I'm never sure what fixed it.
Hope this is of help
Paul
- Make sure your system timezone, date and time is set correctly
Make sure cron is starting -- putin your rc.local. You can use whatever logfile name and location you like of course, but just having one could help track down problems.Code: Select all
/usr/sbin/crond -L /tmp/cronjobs.log
Reboot and check with ps that cron is running.
Use Gcrontab or pschedule (both are OK even if needing a little work yet) to set up a test schedule - or if like me you're a sick man, use e3vi to create one from scratch.
I set up a little scriptfile to echo a few characters to a file.
Set the schedule to say 15 mins in the future, and reboot again.
Watch for the output of your test, and watch the output of your logfile (I used tail -f /tmp/cronjobs.log)
But it's worth a try if yours doesn't work.
The time/date/timezone thing is really important, because otherwise cron might be working but isn't on the same clock as you (!).
As an example, I had the wrong time/TZ set on a gentoo system; I was building it using cron to schedule an emerge; cron triggered a massive download when I wasn't expecting it and I ended using a great lump of my broadband account's download limit in one hit ...
Getting something like this to work when you're struggling means taking a stepwise approach, changing only one thing at a time, and testing after each change. I say that because I'm crap at doing just that and go in scattergun too often, but it's rarely an effective approach, and if it does fix something, I'm never sure what fixed it.
Hope this is of help
Paul
That worked. That line to get crond running was the "missing piece."
Thanks!
I still think Gcrontab is barbaric. I'm a little hazy on what you do to make your crontab active. In Gcrontab, I open my crontab file (I saved it as /etc/crontab, although I'm not sure that's mandatory) and "set current file."
I'd love to be able to edit it with Geany, e3 or whatever and let that be that, but I think that I need Gcrontab to make it active.
I did have to create the file in Geany because I needed the first part to be */5 (to run the job every five minutes) and I couldn't get Gcrontab to do that. But then I had to open the crontab file in Gcrontab and "set" it ...
At any rate, it's working, and I thank you all.
Thanks!
I still think Gcrontab is barbaric. I'm a little hazy on what you do to make your crontab active. In Gcrontab, I open my crontab file (I saved it as /etc/crontab, although I'm not sure that's mandatory) and "set current file."
I'd love to be able to edit it with Geany, e3 or whatever and let that be that, but I think that I need Gcrontab to make it active.
I did have to create the file in Geany because I needed the first part to be */5 (to run the job every five minutes) and I couldn't get Gcrontab to do that. But then I had to open the crontab file in Gcrontab and "set" it ...
At any rate, it's working, and I thank you all.
Remember that crontab and crond are symlinks to BusyBox, so these apps are probaby going to be different than those of core apps in standard distros - just in case that's from where you're drawing experience.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
Bearing in mind alienjeff's apposite comment, my understanding of cron is that, so long as it is running, the only other thing it needs is the presence of the user file in the correct place. i.e. cron runs as a daemon and its job is to check for the existence of the file, and if it exists read it and if there is a job to be executed in the minute of checking, execute it.StevenR wrote:I'm a little hazy on what you do to make your crontab active ... I think that I need Gcrontab to make it active.
Gcrontab is only a way of maintaining /var/spool/cron/crontabs/root (or whatever user) so far as I can see, althought "barbaric" is a little strong!
I have little experience of cron except getting it running on puppy so if I'm wrong in any matters of fact I hope someone will correct me.
paul
Thanks, cron is now running smoothly! I ran this through the command line and everything came to life. Even though the thread is over two years old, the advice is still good. I just started playing with Puppy 4.3.1 and can finally sit back and watch some PHP scripts run automatically. Now to add the command to the startup script.../usr/sbin/crond -L /tmp/cronjobs.log
cron variables
Hi,
I am trying to set up a cron job where the output is to a file and the filename is appended with the date & time.
I have been able to do this before using -%d-%m-%Y-%H:%M but this does not work in Puppy.
Does anybody have any ideas?
Thanks for your help.
Kino
I am trying to set up a cron job where the output is to a file and the filename is appended with the date & time.
I have been able to do this before using -%d-%m-%Y-%H:%M but this does not work in Puppy.
Does anybody have any ideas?
Thanks for your help.
Kino
cron half working for me using frugal install Puppy 5.2.8
I can execute my script in RoxTerm just fine. The script is
perl -T youtube_wget_video.pl http://www.youtube.com/watch?v=Fh4wKUnoKtw mp4
When I put this same script in Pschedule, it does not run.
My time and date and time zone is set correctly
I can run a basic hello world script OK using Pschedule.
Pschedule wont EXECUTE NOW my youtube script either.
sh-4.1# ps -ef | grep cron | grep -v grep gives me the following output.
root 6408 1 0 15:09 ? 00:00:00 /usr/sbin/crond -L /tmp/cronjobs.log
plus I know cron is running because it does a delayed "hello world" output to the screen.
I've put /usr/sbin/crond -L /tmp/cronjobs.log
in my rc.local.
but cronjobs.log always has a zero size. Nothing gets logged to it.
I've opened /var/spool/cron/crontabs/root and looked for extra char's. I found none.
I would like to eventually be able to use Pschedule or cron to download youtube videos from midnight to 6a and do hard disk backups during these hours too.
Any thoughts as to what I may be doing wrong?
perl -T youtube_wget_video.pl http://www.youtube.com/watch?v=Fh4wKUnoKtw mp4
When I put this same script in Pschedule, it does not run.
My time and date and time zone is set correctly
I can run a basic hello world script OK using Pschedule.
Pschedule wont EXECUTE NOW my youtube script either.
sh-4.1# ps -ef | grep cron | grep -v grep gives me the following output.
root 6408 1 0 15:09 ? 00:00:00 /usr/sbin/crond -L /tmp/cronjobs.log
plus I know cron is running because it does a delayed "hello world" output to the screen.
I've put /usr/sbin/crond -L /tmp/cronjobs.log
in my rc.local.
but cronjobs.log always has a zero size. Nothing gets logged to it.
I've opened /var/spool/cron/crontabs/root and looked for extra char's. I found none.
I would like to eventually be able to use Pschedule or cron to download youtube videos from midnight to 6a and do hard disk backups during these hours too.
Any thoughts as to what I may be doing wrong?
You should post in the pschedule thread and Zigbert might answer.
I'm not an expert but other Puppy users seem to use
the wget command to download???
_____________________________
Zigbert has written a script called pclock
One of the features is to execute a command after a certain number of
minutes over and over. (It's not explained very well by Zigbert
so few people know of the feature)
You should try it as well.
__________________________________________
I'm not an expert but other Puppy users seem to use
the wget command to download???
_____________________________
Zigbert has written a script called pclock
One of the features is to execute a command after a certain number of
minutes over and over. (It's not explained very well by Zigbert
so few people know of the feature)
You should try it as well.
__________________________________________
- RetroTechGuy
- Posts: 2947
- Joined: Tue 15 Dec 2009, 17:20
- Location: USA
For vids, I use the Firefox plugin "Video Downloadhelper"don570 wrote:You should post in the pschedule thread and Zigbert might answer.
I'm not an expert but other Puppy users seem to use
the wget command to download???
https://addons.mozilla.org/en-US/firefo ... src=search
Click on the down-arrow icon that appears next to the rotating "atom". Select format/size and save it somewhere.
Of course, that doesn't give you a way to chron job it to run in the middle of the night...
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]