- CheckMates
- :
- Products
- :
- Quantum
- :
- Security Gateways
- :
- Re: Unable to create cron job for arp
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unable to create cron job for arp
Unable to create cron job with below command
add cron job CCTeam_ArpEntry command "arp" recurrence daily time 12:03 and sendin this output to my email.
This is what I am getting in email "/bin/bash: arp: command not found"
Same time if I do given command "uptime" in cron job, email output shows fine.
Am I missing something here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check manually if "arp" is available with bash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Checked manually arp is there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[Expert@DallasSA]# which {arp,cat,uptime}
/sbin/arp
/usr/bin/cat
/usr/bin/uptime
cronjobs are run in a non-interactive, non-login shell instance. From looking at an R81.10 system, it appears /sbin is added to the $PATH in /etc/profile, which is only run for login shell instances.
Include the full path to arp in your cronjob specification, or make a shell script which starts with '#!/usr/bin/bash --login' and run that script in your cronjob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure what full command you are asking me to specify in CLI?
I am using this command for running cron job and it works perfectly.
add cron job CCteam_ArpEntry2 command "cat /proc/net/arp | grep eth1.70 | sort -k 6" recurrence weekly days 1,2,3,4,5 time 10:00
I don't want to complicate much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like I said, the full path to arp. A non-interactive, non-login instance of BASH doesn't know to check /sbin for executables. When you try to run 'arp' without the full path, it won't work because BASH can't find an executable with that name, which is what the error "command not found" is telling you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Whats exact command you used? If you send it, I will try it in the lab.
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cat /proc/net/arp command works fine
