The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
73 views

Stop execution of a function after a given time in PHP

I have five exec() functions in my script. I want to set it up so that if a function fails to respond in a given time, the function will be killed and the next function will start its execution. ...
1
vote
0answers
167 views

execl: couldn't exec `/bin/sh'

I accidentally moved the whole bin, boot, dev and etc directory. After moving everything back I get the following error email from various cron jobs: execl: couldn't exec `/bin/sh' execl: No such ...
1
vote
2answers
132 views

How to invoke shell script while staying in interactive mode

When I call: execl("/bin/sh", "/bin/sh", (void *) NULL); The /bin/sh/ program is started, which opens a shell in which I can type commands. However, if I call: execl("/bin/sh", "/bin/sh", ...
1
vote
3answers
37 views

Is there a way to use > operator in find -exec

I'm trying to empty lots of files under a certain folder. >file or cat /dev/null > file or echo "" > file can empty file. find . -type f -exec blahblah {} \; can find files and do something ...
0
votes
1answer
271 views

Compile the kernel to increase the command line max length

Following up on http://stackoverflow.com/questions/14176089/system-command-line-max-length-in-perl, which say the max length for exec/command line arguments is controlled by ARG_MAX. So I want to ...
1
vote
1answer
216 views

Batch run mogrify including subdirectories

The command mogrify -format jpg *.NEF when run in a directory converts all *.NEF files to JPEGs. What I want to do is to be able to run mogrify in *.NEF files inside subdirectories as well using one ...
0
votes
1answer
70 views

Preventing Apache to access root FS via exec

Actually I discovered that I can access the root via exec in php something like <?php echo exec('cat /etc/passwd'); ?> will print the content of the passwd file, note that with cd command ...
1
vote
3answers
1k views

Argument list too long for xargs/exec

I'm working on a CentOS server and I have to move around and cat together millions of files. I've tried many incarnations of something like the below, but all of them fail with an argument list too ...
1
vote
1answer
60 views

Pass result of the command to exec

I have a kind of "bash newbie" question: how do I pass the result output of one command to exec. The result of the first command is the name of other command, so exec should be able to execute it.
0
votes
0answers
255 views

PHP exec iconv doesn't work

I have an .sh script and an iconv command inside. I can't use the PHP iconv function. I don't knwo why but with my script the iconv command doesn't do anything. It's creating an empty file without ...
0
votes
1answer
151 views

GNU find .extension files and -exec, while new .extension files are being made

Here is a problem, can someone please explain or provide some references. I've been trying to read since an hour but can not find the answer. Suppose, I have process1 going on a pool of directories. ...
0
votes
1answer
26 views

backup time machine style

I would like to find a more solid and handy solution to my small problem.. My idea is to backup every midnight my home directory incrementally, so I want only the modified files (of today) to be ...
0
votes
4answers
6k views

How to combine tar command with find

Find command giving this output [root@localhost /]# find var/log/ -iname anaconda.* var/log/anaconda.log var/log/anaconda.xlog var/log/anaconda.yum.log var/log/anaconda.syslog ...
1
vote
1answer
861 views

ffmpeg working when SSH but not when PHP exec

I am not sure why so first here is the error Array ( [0] => ffmpeg: error while loading shared libraries: libvpx.so.1: failed to map segment from shared object: Permission denied ) my PHP ...
3
votes
1answer
6k views

Perrmission to run specific command by sudo as www-data users without password

I have a webserver that also plays internet radio. As www-data user I want to run some commands, for example I've made this in /etc/sudoers file: www-data ALL=(ALL) NOPASSWD: /usr/bin/amixer ...
0
votes
0answers
189 views

sudo: a tale of two folders

I have 2 folders: drwsrwsr-x 25 ftpuser www-data 4096 Jun 7 13:45 demo drwsrwsr-x 28 ftpuser www-data 4096 Jun 7 12:43 dev and a script to create a folder within these. When I run the script ...
2
votes
2answers
5k views

execvp: No such file or directory

I wrote a script ~/_bin/bcg to call another script that uses gimp to re-size a random image from a directory and then write it back out to another file. My (toplevel) script then uses hsetroot to set ...
2
votes
2answers
532 views

Why is find exec grep > file an Infinite Loop?

I was trying to collect all of the Message-ID: headers (lines) in a directory with 200K .eml (plain text) files. A bit naively, I said: find -type f -exec grep -Fi "message-id:" {} \; > ...
0
votes
1answer
572 views

Script that runs a command with 'exec' doesnt end until 'Enter' is pressed

We have a KSH script that runs a process using exec and hangs. We want to be able to run it automatically and keep it running in background. We tried this: ./myScript.ksh & However this left ...
1
vote
2answers
461 views

Removing folder structure when making a tar from a folder

Ok I don't really want to waste any more time on investigating this but I do want to offer a .tar option for download instead of just zip. $archive = ...
0
votes
2answers
586 views

Expect: Modify Ctrl-C Behavior

While exec is running a program, I would like Ctrl-C to terminate the program and resume the script, instead of killing the script. What's the best way of accomplishing that?