Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:23:22+00:00 2026-06-02T08:23:22+00:00

I am trying to run a string of nohup commands to get server statistics.

  • 0

I am trying to run a string of nohup commands to get server statistics.
However I get an error of ‘No such file or directory’. Note that the 3 nohup calls are embedded in a script which is executed through a cron job. And the first nohup works but the other 2 return an error. Ironically enough, when run on a different server, the script works fine.

  • Commands

    nohup vmpstat -a -n 60 1000 > myvmstats
    
  • (works)

    nohup mpstat -P ALL 1 1000 > mympstats
    
  • (returns: nohup cannot run command mpstat: no such file or directory)

    nohup iostat -t -x 60 1000 >myiostats
    
  • (returns: nohup cannot run command iostat: no such file or directory)

Any idea what’s wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:23:23+00:00Added an answer on June 2, 2026 at 8:23 am

    The usual problem with scripts that run from the command line and not when run by cron is ‘environment’. There are many questions on SO where this is exemplified, including:

    • Perl script works but not when via cron
    • Why does my command line not run from cron?
    • Bash script not executing in cron correctly
    • How can I set environment variables that crontab will use?

    For debugging purposes, add a command/line to the cron-run script that does:

    env > /tmp/cron.job
    

    Review whether the PATH there includes what you expect, and in particular, whether it includes the directory (directories) where each of the three programs is installed. And do check that you run the programs you expect from the command line:

    which vmpstat mpstat iostat
    

    It is a reasonable guess that the two ‘missing’ commands are not in a directory on PATH when your script is run by cron. And cron gives you a bare minimal environment; it is completely unlike at in that respect.

    See also:

    • Crontab and testing a command to be executed
    • How do I add pre-hook and post-hook scripts that run before all of my cron jobs?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to run through a dictionary string and write the contents to file that
I'm trying to run this code but this error appear: Uncaught TypeError: string is
I am developing a VB.NET ASPX file and am trying to run a string
Basically, I'm trying to run the batch file that was copied on the remote
I'm trying to run a function that parses a large string that contains newlines,
I'm trying to run a regex string in my code that will pick up
I am trying run a program from a qmake .pro file which modifies the
I am trying to run the following code: public BigDecimal valuate(String searchTerms, String categoryPath)
I'm trying to run some shell command if a string is not present in
I've been trying to run a program that will invert the order of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.