WebFaction
Community site: login faq

I have a php script that populates a database, I would like to use the nice command to not increase server load innecesarily. I have tried several commands without luck:

/bin/nice -n 10 "cd ~/webapps/example; php54 ~/webapps/example/example.php"
/bin/nice -n 10 "php54 ~/webapps/example/example.php"
/bin/nice -n 10 "/usr/local/bin/php54 ~/webapps/example/example.php"

and so on. All of them show:

/bin/nice: /usr/local/bin/php54 example.php: No such file or directory

ideas?

asked 20 Jul '13, 17:52

mecluy
1537
accept rate: 0%

edited 20 Jul '13, 18:51


You've almost got it right, in the 2nd and 3rd examples just omit the quotes and it should work. For the first one you should either wrap the two commands into one script and then nice that or just do your cd first then nice the PHP script (the "cd" doesn't have to be nice'd).

permanent link

answered 20 Jul '13, 22:53

waynek
4254
accept rate: 27%

Thanks, works fine! I've tried to include the "cd" because of the error message I was receiving ("No such file or directory").

(21 Jul '13, 09:36) mecluy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×97
×1

question asked: 20 Jul '13, 17:52

question was seen: 4,249 times

last updated: 21 Jul '13, 09:36

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM