cpio in shell called from php


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cpio in shell called from php
# 1  
Old 10-07-2005
cpio in shell called from php

I have a php program that calls a shell script, this part works fine and most of the commands work. However, I have a cpio command in the shell script, and for some reason this doesn't work. If I catch the return code, it's 1 which means it terminated with an error, but I get no other indication of an error in php or the shell. Has anyone done this before?
I'd really appreciate any help I can get.

Monica
# 2  
Old 10-07-2005
Does the CPIO task take a longer time to execute relative to the PHP routine?
# 3  
Old 10-07-2005
no, it dies immediately... I'm thinking it might be a permissions problem, I'll post back in a few.
Thanks Smilie
# 4  
Old 10-07-2005
Computer

I got it to work! The problem is that I was trying to read/write into a directory that is out of my cgi-bin path, and I guess that makes them unreachable to php. I also didn't have all my permission bits open. I corrected all that and now it runs fine.
Thanks anyway!

Monica
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. Shell Programming and Scripting

Simple sh called by PHP to create users HELP

Hello! Im trying to create a shell script that will be executed by PHP like: $return = shell_exec("./makeUser.sh $user $pass"); My shell script looks like: #!/bin/bash NAME=$1 PWD=$2 pass=$(perl -e 'print crypt($ARGV, "password")' $PWD) useradd -m -p $pass $NAME && echo "0" ||... (2 Replies)
Discussion started by: blak422
2 Replies

3. UNIX for Dummies Questions & Answers

Interpreting Shell Script errors when called from CRON

Hi All, I am calling a series of shell scripts via CRON so everything is running as root. However, in my error log file I am seeing the following errors. Please can anyone offer any advise as to the possible causes and solution to prevent the errors from appearing. The Error 1227 seems to... (2 Replies)
Discussion started by: daveu7
2 Replies

4. UNIX for Dummies Questions & Answers

shell program- how many times a function is called

We have a program source C and is required to indicate how many times each function is called from the C program. also print the line number where there is a call. I've tried something like this: #!/bin/sh for i in $*;do if ! then echo $i is not a C file. else echo $i... (0 Replies)
Discussion started by: oana06
0 Replies

5. Shell Programming and Scripting

Can a shell variable be called in a cobol program

Hi All, I have a file which sets all the variables on unix , based on the hostname. Currently these variables are hardcoded in the cobol programs.I was wondering if unix variables can be used in Cobol programs ? Example : I have a variable $SHTEMP which is set based on the following : Prod... (2 Replies)
Discussion started by: nua7
2 Replies

6. UNIX for Advanced & Expert Users

Why only partiial shell script got executed when called in Java

I'm trying to call shell scripts from Java for DB operations. Using a very simple test, for some reason, one line of (ALTER TABLE) in the shell simply won't be executed while the exit value from the call is "0" (valid exit). When I run the script directly in Unix, it gets executed perfectly fine!!... (4 Replies)
Discussion started by: zmwang
4 Replies

7. HP-UX

What is this shell called ?

:wall:What is this shell called ? "/sbin/sh" When I run "echo $SHELL" command on my HP-UX,I get above output. In Linux It was "/bin/bash". Which is bash shell. (5 Replies)
Discussion started by: manalisharmabe
5 Replies

8. UNIX for Dummies Questions & Answers

How to retrieve the value of variable in shell script which is called by crontab

There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg) configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The... (4 Replies)
Discussion started by: jadoo_c2
4 Replies

9. Shell Programming and Scripting

Need help with ksh script that uses sqlplus, called from PHP

I have a ksh script that connects to sqlplus and dumps the query results into a file. The script works file when I run it from the command line, however, when I call it from PHP using system(), exec(), or shell_exec() commands, the script doesn't seem to run the query. It will create the text file... (7 Replies)
Discussion started by: j2owilson
7 Replies

10. Shell Programming and Scripting

gzip in shell script called by cron

I'm puzzled by this one. I hope you can explain it to me. I have a ksh shell script that gzips a file among other things. This works perfectly fine when the script is manually run through a shell. However, when the same script is run through cron, it does everything correctly, but it will... (2 Replies)
Discussion started by: hbau419
2 Replies
Login or Register to Ask a Question