Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

learn more… | top users | synonyms (1)

2
votes
2answers
2k views

bash script returns “out of memory” in cron, but not in shell

I'm running a nightly bash script to sync a remote folder (source) with a local folder (target). I've tested this script, based on rsync, and it works fine in a root shell. It takes time since there ...
2
votes
2answers
1k views

Problems Using WGET to transfer files from an FTP Server

I make use of wget to get files from an FTP server. I do this: wget ftp://username:Password@XXX.XXX.XX.XX/public_html/images/audiothumbs/* . After I download about a 1600 files, I get this error: ...
2
votes
2answers
4k views

How to run linux bash script from web browser?

Hi I have web server on it also. I had made simple bash script using vi editor..which will open file and then add some lines into it at last it will save automatically...and after that 2-3 linux ...
2
votes
2answers
714 views

SCP from one external server to another

I am trying to a SCP on my local server that copies a file from one remote server to another remote server (Both remote servers use a custom port (xxxx) I am trying: scp -r -P xxxx ...
2
votes
3answers
1k views

Apache 500 Error When Using Symlinks

Here is an excerpt of the deployment script I use to deploy php apps on my CentOS server. echo "Starting Deployment to $SITE_FOLDER (Relase Directory: $RELEASE_DIR)..." svn --username=$SVN_USER ...
2
votes
5answers
2k views

Bash - How to output two commands to file?

I want to output two commands to a file. I want the exact time (date) AND temperature (sensors) to go to file every 5 minutes. I know how to output one command to a file, but two? How to write such ...
2
votes
2answers
2k views

Can you screen a running programme? [duplicate]

Possible Duplicate: Can I nohup/screen an already-started process? GNU screen is great for long running programmes. You can start your programme in it and disconnect and bring your laptop ...
1
vote
1answer
101 views

gzip select directories into separate archives

How would I go about compressing a list of directories into separate archives? I have read solutions that just archive all the directories within a given dir, but there are some I want to skip. ...
1
vote
0answers
51 views

bash scripting comparing 2 things [closed]

My problem is that i have to check what files are included in the $directory, then i have to make a new file with name specified by me and compare if the name doesn't already exist in this directory ( ...
1
vote
3answers
4k views

How do I restore the default bashrc?

I have accidentally overwritten .bashrc. I did the following echo 'export EDITOR=/usr/bin/nano' >> /etc/bashrc Bur I accidentally typed > instead of >>. I guess, it was a bad idea. I ...
1
vote
3answers
411 views

“while read line” returns early when calling ssh “mysql…”

I have a script that reads in data from mysql (the get_sql_results function below) I then read in each line, parsing individual columns with awk. Everything works fine except for the line that assigns ...
1
vote
2answers
238 views

Bootstrap a debian build environment and build source packages with no root privileges

On debian squeeze, I am trying to do the following : fetch sources package from the wheezy source repository bootstrap a squeeze chroot for several architectures build the packages for several ...
1
vote
4answers
842 views

Make cron log rsync only if there was transfer

I have this crontab running every 5 minutes: date >> ~/18/rsync.log rsync -vaz user@r18:~/assets ~/18 >> ~/18/rsync.log 2>&1 It adds this to the log file every 5 minutes: Thu ...
1
vote
3answers
1k views

I can run a script locally, but cannot do “ssh HOSTNAME /path/to/script.sh”

I have a linux server, and a linux desktop. I have written the following simple script to dump the database of a django web application: #! /bin/bash set -o errexit cd $(dirname $0) . ...
1
vote
1answer
920 views

Setting environment variables for a service without a login shell on Debian

I have created a linux service that runs as a deamon (and gets started from /etc/init.d/X). I need to set some environment variables that can be accessed by the application. Here's the scenario. The ...
0
votes
1answer
103 views

Password less mysql access to specified user/script only

In addition to this question: Performing root mysql operations in bash scripts I'd like to ask how to limit/allow this action (performing root administrative actions): mysql --local-path=mypath -e ...
0
votes
1answer
733 views

Kill child process when the parent exits

I'm preparing a script for Docker, which allows only one top-level process, which should receive the signals so we can stop it. Therefore, I'm having a script like this: one application writes to ...
0
votes
2answers
361 views

Gnu parallel not utilizing all the CPU

I have a simple python script that read from stdin (a single line), do some processing (string parsing, no IO involved) and output to stdout e.g. python parse.py < in.txt > out.txt I have an ...
0
votes
6answers
10k views

Bash script runs manually, but fails on crontab

I'm a newbie to shell scripting. I have written a shell script to do incremental backup of MySQL database.The script is in executable format and runs successfully when executed manually but fails when ...
0
votes
1answer
109 views

Chroot seems to be missing some progs/libs. What's necessary to get default commandline behaviour?

I've set up a chrooted environment using this tutorial. But the commandline isn't displayed correctly. Instead of the usual user@hostname:/home/user# it displays -bash-4.1$. What programs are needed ...
0
votes
2answers
4k views

bash shell command runs fine at command prompt, but not in my .sh script?

I'm trying to write a script that restarts tomcat, but can't figure out what my problem is. if I execute the following command at the command prompt it runs fine: /usr/local/etc/rc.d/tomcat7 start ...
0
votes
2answers
1k views

How do I completely remove all references to couchdb from Ubuntu 11.10?

I have removed and purged couchdb from Ubuntu, but if I type "couchdb" in the shell at any point, the system still tries to start it up before crashing. I checked /usr/bin, and I still have references ...
0
votes
1answer
86 views

remote keyboard not recognized

I'm logged into a remote server using putty ssh. The problem is that keyboard keys are not working as I was expecting. I'm talking about directional keys and tab. TAB is working as in MS Windows, ...
0
votes
5answers
5k views

want user will logout from shell on exit of bash script

I want, when a linux user exits from a shell script, that it also logs out from the bash shell. Is this possible?
0
votes
5answers
2k views

Problems with sudo in path

Using: Linux nomemory 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux I have a folder in my $HOME called ~/.scriptfarm/scripts where i keep some of my custom scripts. ...
0
votes
2answers
507 views

Updating the $PATH for running an command through SSH with LDAP user account

I am setting up a Mac OSX 1.6 server to host Git repositories. As such we need to push commits to the server through SSH. The server has only an admin account and uses a user list from a LDAP server. ...
-1
votes
1answer
44 views

create an array of dates in bash scripts and match it with current date [duplicate]

Actually i want to create an array of dates and compare it to the today date if it match with the current date then execute test.sh file otherwise exit the loop in bash script. I did like this... ...
-1
votes
3answers
271 views

linux + generate new file with specific structure from text file what the best option

in my Linux machine I have the file orig-file.txt this file include now 4 fields but they could be less or more ( this file generate by other application ) I need advice - what the best option to ...
-3
votes
1answer
671 views

Why ulimit shows different outputs? [closed]

I am very confused, and I tried a lot but I didn't get any way to overcome from a bug. I am posting the same. I am hoping that someone helps me. My problem is, When I run ulimit -n it shows 12000. ...