Questions tagged [shell-scripting]

Programming in an Interpreted language executed by a running Shell

Generic programming in an Interpreted language (as opposed to compiled) executed by a running Shell. Sometimes referred to as "Glue Code" due to the practice of managing the execution and output of one or more compiled binaries and passing said output to another series of commands.

621 questions
0
votes
1 answer

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 file exclude.txt: No such file or directory…
binaryorganic
  • 6,021
  • 4
  • 18
  • 19
0
votes
1 answer

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 for testing atm) * * * * *…
Greg
  • 103
  • 2
0
votes
2 answers

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 use powershell or an external tool or not. For…
0
votes
2 answers

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

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 do write my backup script in PHP or shell? Or does…
davidjhp
  • 700
  • 3
  • 7
  • 14
0
votes
2 answers

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? These scripts need to be started really once, so…
0
votes
2 answers

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 >/dev/null 2>&1 The script contains this:…
jurchiks
  • 103
  • 3
0
votes
1 answer

How to create a mailing list in Unix

I have to write a shell script using a here document that will send a personalized greeting email to each student on a mailing list. I am using following script to sent mail to individual users: $ cat > here.sh mail $1 << endoftext Dear $1 Welcome…
Rakhee
  • 1
  • 1
0
votes
2 answers

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 by specifying them at the command line, along…
0
votes
3 answers

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 that i could get only ERROR or NO ERROR in case…
User4283
  • 781
  • 3
  • 10
  • 27
0
votes
1 answer

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 with a Shell Script or with a C POSIX program?
Necronet
  • 283
  • 2
  • 5
  • 17
0
votes
1 answer

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 the BusID's of each device listed when I run…
Danny
  • 233
  • 2
  • 9
0
votes
1 answer

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 information_schema.TABLES WHERE…
krunal shah
  • 335
  • 1
  • 3
  • 13
0
votes
2 answers

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 in shell script. script.sh #!/bin/sh echo 'SELECT…
krunal shah
  • 335
  • 1
  • 3
  • 13
0
votes
1 answer

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 new subfolder. I know I can move all the images…
Professor Frink
  • 529
  • 4
  • 7
  • 15
0
votes
2 answers

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 server-example sendmail[12732]: p937blksdh3:…
Mike B
  • 11,871
  • 42
  • 107
  • 168