Hi, im not really good with my english and i dont know much in Qnx.
I have to run an application every hour.
I read that cron and crontab do that.
But the problem is that i try to configure it bau it really don`t work.
Please if someone write the steps to do that.
How can i restart cron
2)Every time i reboot the machine i have to start Cron -L -v again.
Is there any chance that cron start automatically when i rebbot the machine???
I guess you made a typo of “Cron -L -v”? It should be a lower case C like “cron”.
To restart, you first kill it and then start it again:
slay cron
cron -L -v &
To make it auto start, you need to add it into /etc/config/sysinit.1 (assuming you are on node 1).
Please post the output from the following commands:
id
echo $NODE
ls -l /usr/spool/cron.1/crontab/
(you mentioned /usr/spool/cron.1/crontab/root in your above post, but I guess you must have made a typo).
ls -l /usr/spool/cron.1/crontabs/
Good evening! Please help. I’m trying to start some executable file in cron, and it isn’t start. And example with “echo…” not enough. I write in my crontab:
45 16 16 10 0-6 /tmp/myprog
What mean start exutable file by adress /tmp/… at this time. What’s wrong here? It needs to write PATH in environment variables?
Or I must write something like this? :
45 16 16 10 0-6 /tmp/myprog>/dev/con1
Yes, run it with command cron &
2)Program - executable file which move files from qnx fiel system to ntfs (smb mounted). At first I can’t move it cause attributes don’t write, and I replace moving to 2 actions: copy and removing files from initial directory. It works perfect when I start it manually from shell.
3)I made this example from one qnx book : * * * * * echo “Hi!”>/dev/con1 and it write word “Hi” in shell in con1.
Editing crontab with vi? I can’t understand how works with it. What command I must write to change editor to vedit?
5)I can see it. Is it terrible what I edit crontab withh key F4 in “Midnight Commander”?
I write answer in 3)
7)Yes it works, but how start my executable fiel?
I must logging it work like: /tmp/myprog > /tmp/hi.txt ?
You can export EDITOR environment variable to use your preferred editor.
So, I still don’t gen your point. You have to keep in mind than cron does not inherit the environment variables. So if your program runs normally from the console but not when cron spawned it, you should check which environment variables your program need to run.
Ok! Thanks! I’m understand! Maybe my program runs with cron and system utility “sin” too. But I can’t see their work, cause I don’t write this:
“> /dev/con1” after command. I write simply:
sin
*/tmp/myprog
And maybe it runs, but don’t show.
Must write like this:
sin>/dev/con1
*/tmp/myprog>/dev/con1
Is it right? Or how you advice me , to make log.
sin > /tmp/hi1.txt
*/tmp/myprog > /tmp/hi2.txt
p.s. I check environment variables and directory /bin/ to run system utilities is written.