The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
47 views

Highlight code line by line

Following is the shell script that is expected to pick one line at a time from a given file highlight it. #!/bin/sh > myhighlight.txt file='to_study.php' cat $file | while read -r myline do export ...
1
vote
3answers
286 views

scp with password less authentication

scp with password less authentication is working fine but if delete a file on the source it will not get replicated ie the destination directory is not completely replaced with source. I can see the ...
0
votes
1answer
576 views

window shell (batch) script to list files changed since yesterday

Any example of windows xp dos script(.bat) that when run will iterate all subdirectories and list all files that have date updated since yesterday time?
0
votes
1answer
407 views

RSync shell script failing to run as CRON, runs fine manually

I have a simple shell script that runs Rsync. It runs fine if I call it manually from the command line, but when I set it up as a CRON job I get the following error: rsync: failed to open exclude ...
0
votes
1answer
791 views

including the current directory in a .reg script

I have a .reg script: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC\Parameters] "Application"="C:\\Program Files ...
0
votes
1answer
259 views

shell script won't work in cron

I have very smiple script to do a backup, and it is working fine when I run it from the command line, but I am having problems running it as cron job. My cron entry is this: (running it every minute ...
0
votes
2answers
609 views

How can I script creating email aliases for existing mailboxes in Exchange 2003?

I need to create lots of email aliases (more than I want to do manually), so I want to know if there's a way I can script the addition of aliases to existing mailboxes/users. I don't mind if I have to ...
3
votes
1answer
423 views

How can I output the chkconfig results to a file within a shell script?

When I run the following from the linux command line it works properly and populates the chkconfig.bak file correctly : #chkconfig --list > chkconfig.bak But when the command is run from a ...
2
votes
6answers
108 views

Copying files from a server to a set of machines

First of all I am not a trained professional in Networking nor I know much about it. I have some knowledge of GNU/Linux, Shell scripting. One day I wanted to copy a large zipped file to a set of ...
1
vote
3answers
108 views

Copy all files to another location [closed]

I have a folder called "employee" and within that folder there are sub-folders with each employee name. employee >> amar >> akbar >> anthony Each of these folders contain 1 or 2 ...
1
vote
2answers
212 views

Why is this bash script not working?

I'm making a bash script which checks the available space on disk: if [ check_space -gt "85" ]; then echo "removing" else echo "not removing" fi check_space returns a number like 52 and the ...
-1
votes
2answers
142 views

Would it be better security to write a backup script in PHP or shell? [closed]

I have a server running Ubuntu 10, it mostly has PHP websites with MySQL databases. I need to write a backup script to backup the database to zip up all the php files. Is it better security to ...
0
votes
2answers
673 views

Commands /etc/init/boot.local get started before some environment variables get initialized

I have OpenSuse 11.4. I start some on-boot scripts inside /etc/init/boot.local. Where could I move those scripts so that they would be started after all (most) environment variables got initialized? ...
1
vote
1answer
149 views

export_bashrc() bash function to export .bashrc to a server

I am trying to write a bash function shown below.I am trying to scp my .bashrc to the target machine.I want to do modify the following function in the below two ways. 1.I want to enter the password ...
3
votes
2answers
235 views

Measuring “loading time in milliseconds” every minute

I have apache running on a virtual server, which in periods gives very bad performance - even when retrieving static JPG or PNG files. This only happens once in a while, so it's hard for me to ...
0
votes
2answers
673 views

Set up a linux shell script cron job on Plesk 9.5.4

Operating system Linux 2.6.18-028stab089.1 Parallels Plesk Panel version 9.5.4 Set up a test cron job in Settings>Scheduled Tasks>user "root"> * * * * * /var/www/cron/webcrontest.sh ...
2
votes
1answer
1k views

problem executing a bash script with utf8 encoding

I have a bash script encoded in utf8 . Within the script i use sed command using § as a separator . Now when i run execute this script sed complains about the separator. If i use normal char as a ...
1
vote
3answers
1k views

LDAP Account Expiry Script Help

I need to find a way of automatically notifying LDAP account users as to when their passwords will expire and also force them to change their passwords. I am fairly new to LDAP.I am running openldap ...
4
votes
2answers
608 views

Shell script: Find entries in access log with 500 response within a specified date period

Can someone help me with a shell script to figure out the number of 500 HTTP response entries in an access log within a time frame specified?
4
votes
2answers
2k views

How to grant sudo rights only to specific script files?

I would like a user to have sudo rights (without password check) to a couple of shell scripts under a specific directory (in my case, /usr/local/tomcat7/bin), and to nowhere else. What's the simplest ...
2
votes
1answer
95 views

Move all files to their own folder

Is there any way on a linux box to move every file in a directory into their own sub directory (i.e. make a directory named after it and move it in)?
1
vote
2answers
299 views

How to find the IP address of the local Linux workstation

I am creating a shell script that should do some local settings and echo the IP of the machine in a text file. The reason I need to do this is to get the IP in a PHP script and use it from there as ...
1
vote
1answer
460 views

(Ubuntu) How to configure startup application?

I'm trying to configure the startup application in Ubuntu. I want to perform the following tasks in sequence when a user login to Ubuntu's desktop: Ensure that the webserver is started ...
1
vote
2answers
2k views

Linux FTP upload: “No such file or directory”, but file exists

I want to upload backup archives from one server to another server using ftp. In my backup cronjob I use this script to upload files: MEDIAFILE=/var/somedir/somefile.encrypted if [ -r $MEDIAFILE ] # ...
11
votes
4answers
1k views

Can a shell script wait for a file to change and take action?

I wonder if I can write a script that will monitor for a change in a file and execute some action when the change is detected. Detailed explanation: OpenVPN writes its status to a file every 1 ...
1
vote
1answer
690 views

pam_exec.so PAM module does not export variable PAM_USER as stated in the documentation

I'm trying to use the pam_exec.so PAM module to execute a script which needs to know the username/password coming from the application (OpenVPN in this case). I have a script that executes printenv ...
0
votes
2answers
140 views

Cannot log into mysql after invoking mysql from shell script

(My first question here, so if I am flouting any conventions, I apologize in advance!) This is my first attempt at creating a shell script. I am trying to create new databases and users and passwords ...
1
vote
1answer
951 views

PAM: How can I create a service which passes username/password to a script?

I'm setting up a PAM service for OpenVPN, such that the OpenVPN PAM module can authenticate a username/password to an external service that I will implement using a shell script. The OpenVPN PAM ...
1
vote
2answers
274 views

Unix quota per user script

Is there any way to automate user's home folder qouta by script. I have auto useradd script, and I want to add code in script about quota for home folder of size 2 GB. For example: edquota sally ...
5
votes
3answers
121 views

Returning A List Of Quoted Files Paths Using Find

I would like to create a tarball that contains files from a directory that have a ctime of less than 30 days. Most tutorials I have found have basically recommended doing something like this: tar cvf ...
1
vote
0answers
109 views

Shell Script to deploy Django

I have yet to find an Amazon Web Services AMI that deploys a Django environment. I want to deploy with mod_wsgi and also include modules like markdown, lxml, beautiful soup, PIL, and others. Is ...
2
votes
3answers
768 views

Shell script to scan size of directories and email when too big

I am at work right now, and my superiors asked me to write/find a shell script for the Red hat Server edition that checks a folder size, and if it's above a certain limit, it will send an email.Can ...
0
votes
2answers
397 views

How to iterate over a list of files and perform an action on them

I want to write a script (or preferably an alias) that does the following: Find all the files matching a pattern *.jar Iterate over all those files, and run jar tvf <jar file name> | grep ...
2
votes
2answers
557 views

Date calculation in linux

In linux how to get the date of the first day of the week monday. I know that date +"%u" gives the current day of the week from this how to get the date of the monday of that week
-1
votes
2answers
218 views

Where can i find the advanced home dir backup scripts

Is there any script for linux which can backup the home directories and mysql databases in separate directories . i mean best of all scripts which is general and any one can use that one. By backup i ...
0
votes
3answers
116 views

listing file with for loop using array and if

I've written a script to check files in different directories and want this script to show me error in case a file does not exists. But It show me Both ERROR and NO ERROR due to loop. ow to adjust so ...
1
vote
2answers
46 views

echo with each parameter on its own line

I would like an output similar to ls -1d, but I don't want to check if each file exists. I would prefer to just list the files. I could use echo, but echo only puts a space between files. How can I ...
0
votes
1answer
924 views

creating folder with date range linux shell or C

Hi i need to create a series of folder with a range of date for exmaple createdir 2010-02-02 2010-02-05 will create : 20100202/ 20100203/ 20100204/ 20100205/ What the best way to do this ...
0
votes
1answer
374 views

Taking BusID output from lspci and storing in a variable

I am trying to get the BusID's of each video card stored in a server and putting them in a variable each to be used for an input to a simple find and replace perl script. How would I go about getting ...
0
votes
1answer
203 views

How to append xml data inside xml file with shell script?

script.sh #!/bin/sh mysql -u root -pmysql --xml << eof SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb" FROM ...
0
votes
2answers
525 views

Convert string to xml in shell script?

I have written a script which is fetching data from database. Now I want to enhance that script to create a xml file with data which is return by database. How may i convert that string to xml file ...
0
votes
3answers
3k views

How to run mysql commands through shell script?

mysql -u root -pmysql; SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb" FROM information_schema.TABLES WHERE ...
4
votes
3answers
3k views

Does mysqldump return a status?

I am creating a script that backups a mysql db using the mysqldump utility. I am writing this script in the shell "sh". I would like to capture the output status of mysqldump in the script (i.e. if ...
2
votes
4answers
642 views

how to change permissions of specific file type

file * | grep 'ASCII text' | chmod -x chmod: missing operand Try `chmod --help' for more information. The above command gives me error.Basically I am trying to find all the files whose type is ...
0
votes
1answer
349 views

Move all images in folder to subfolder, and update all references to those images to their new location?

I have a folder which contains a ~50 text files (PHP) and hundreds of images. I would like to move all the images to a subfolder, and update the PHP files so any reference to those images point to the ...
1
vote
2answers
499 views

delete string recursively from all index.php files in a home folder

We need a shell script to find and replace a piece of injected code within all index.php files within a /home folder
0
votes
2answers
109 views

How To Generate A Report Of All Messages Triggering A Specific NDR

CENTOS 5.x | Sendmail Hello All, I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example: Jan 11 07:43:34 ...
4
votes
2answers
3k views

ssh fails to execute remote command when run from cron bash script - works from CLI

I have a script, written in bash, which runs from cron. One of the first things it does is SSH to a remote host and retrieve a list of files in a directory. Everything works fine when run from the ...
2
votes
3answers
3k views

control a bash script with variables from an external file

I would like to control a bash script like this: #!/bin/sh USER1=_parsefromfile_ HOST1=_parsefromfile_ PW1=_parsefromfile_ USER2=_parsefromfile_ HOST2=_parsefromfile_ PW2=_parsefromfile_ imapsync \ ...
2
votes
2answers
459 views

What is the best Android phone for remote ssh administration/scripting? [closed]

I've got a Moto Droid that I use with connectbot for remote admin on Linux webservers. However, I'm wondering if there are any Android phones out there with better hard keyboards for use with ...