Sponsored Content
Full Discussion: Script not running properly
Top Forums UNIX for Dummies Questions & Answers Script not running properly Post 302169773 by chris1234 on Friday 22nd of February 2008 12:45:10 PM
Old 02-22-2008
Script not running properly

I created a script before which was this :-

Code:
 cd /mike/dataxfer
     for dir in *; do
     if [ -d ${dir}/priceops ]; then
     ssh -l abc nissan "mkdir -p  /mike/web/$dir"
     scp -r ${dir}/priceops nissan:mike/web/${dir}/
    fi
    done

exit 0

This script worked fine for me with no problem. It will do a recursive search if that priceops directory exist then it will create the parant directory and thew priceops folder in the remote machine (nissan) and then will do a scp to copy all the contents of that priceops folder. It worked fine.

But now they change the priceops folder to( Price Shops ) folder. so i changed my script to this:-

Code:
  PRICE_SHOPS="Price Shops"
     cd /mike/dataxfer
     for dir in *; do
     if [ -d ${dir}/$PRICE_SHOPS ]; then
     ssh -l abc nissan "mkdir -p /mike/web/$dir"
     scp -r ${dir}/$PRICE_SHOPS nissan:/mike/web/${dir}/
    fi
    done

exit 0

and it is not working for me neither i am getting any errors also. when i type
./file_transfer1.sh
to run my script i dont get any response of files transfered or any errors. What is wrong or anyone care to help?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

expr not outputting properly.. bsd sh script

When i run sh -x test.sh, expr outputs x=expr $x + 1 instead of doing the arithmetic.. been working on this overnight.. and its being a pain in the arse if you ask me.. :confused::confused: #!/bin/sh #script for downloading numerical filenames chap=1 p=1 count=0 x=1 while do if ... (2 Replies)
Discussion started by: aspect_p
2 Replies

2. Shell Programming and Scripting

cron does not execute script properly

I have a simple script that checks for certain printers and records them to a file. When I run the script manually at the command prompt, it works perfect, but when I run the script via cron, nothing happens. No errors reported, and no records are written out. I'm using Solaris 10. Below is the... (4 Replies)
Discussion started by: lmatlebyane
4 Replies

3. Shell Programming and Scripting

A script doesnt work properly when crontab

Hi, I have a script which does a tar and sends it to another server as backup. Script is as below # Locations to be backed up. Seperate by space BACKUP_LOCATIONS=/repos/subversion BACKUP_BASE_FOLDER=/bakpool BACKUP_FILE_NAME_ROOT=svn-backup START_TIME_DISP=`date` START_TIME=`date... (11 Replies)
Discussion started by: digitalrg
11 Replies

4. Shell Programming and Scripting

Script not running properly when run from Crontab

Hi I am a novice Linux/Perl user and am struggling to overcome what I am sure is a simple problem. I am using a perl program to create a shell script daily containing between 10 and 30 "at -f" commands for the same day. Then I change the file attributes to allow the file to be executed. When... (2 Replies)
Discussion started by: simoncjones
2 Replies

5. Homework & Coursework Questions

Script does not execute properly

I am trying to create a Unix script that when ran will provide a veiw of the files of the week that the user inputs, I have this one down. Then I would like them to be able to type in one of the files that is in that week and it displays that file. The script that I have keeps looping the week... (4 Replies)
Discussion started by: Goob
4 Replies

6. Shell Programming and Scripting

Shell Script Email not working Properly

Hi GURU's, I'm using a Shell Script to send email's as an attachment. I'm Storing the email address in a table and catching in a variable. MAILLIST=`noarg sqlplus -s $OraUsr << EOF set heading off set feedback off set echo off SELECT email_ids FROM tpemail_table WHERE... (9 Replies)
Discussion started by: karthikraj
9 Replies

7. Shell Programming and Scripting

script line not working properly

Hi , I am using the below command in script. $_IDLETIME is returning value if i execute the script manually. sar > $_LOCATION/sar.txt _IDLETIME=`tail -2 $_LOCATION/sar.txt | head -1 | tr -s ' ' ' ' | cut -d ' ' -f8 | cut -d '.' -f1`; if But it s not returning any value if it put the... (3 Replies)
Discussion started by: ahamed
3 Replies

8. Shell Programming and Scripting

Shell script not working properly

Hello, i have below shell script to process ftp get from server and create file list afte finish. this shell scipt has 6 parameter input. unfortunately, it is only working to get the file and terminated before creating file list. please help. thanks, #!/bin/ksh ## example usage :... (3 Replies)
Discussion started by: daryatmo
3 Replies

9. Shell Programming and Scripting

Script does not run properly

Hello everybody Im learning bash scrpting language and im making a script that read a file line by line and it does a comparison if in a line start with a letter or number and it will delete every ones that start with a letter. But im getting some errors First of all, this is the script's... (5 Replies)
Discussion started by: alienrunes
5 Replies

10. Shell Programming and Scripting

Process Instance not running properly.

I have run 10 instances of the process eg, process name is BG nohup /WP01IRB1_irbapp/IRBWPROD/RB/bin/BG -c 1 -t 23 -a '-caTop TESTBILLCYCLE='5FEB13_81PT19NPT''>a.txt & nohup /WP01IRB1_irbapp/IRBWPROD/RB/bin/BG -c 2 -t 23 -a '-caTop TESTBILLCYCLE='5FEB13_81PT19NPT''>b.txt & nohup... (3 Replies)
Discussion started by: ankitknit
3 Replies
XEN-UPDATE-IMAGE(8)					 Perl Programmers Reference Guide				       XEN-UPDATE-IMAGE(8)

NAME
xen-update-image - Update the software installed upon offline Xen images. SYNOPSIS
xen-update-image [options] imageName1 imageName2 .. imageNameN Help Options: --help Show this scripts help information. --manual Read this scripts manual. --version Show the version number and exit. General Options: --dir Specify the directory which contains the image(s). --lvm Specify the LVM volume group which contains the image(s). --evms Specify the EVMS container which contains the image(s). OPTIONS
--dir Specify the directory which contains the image(s). --evms Specify the EVMS container which contains the image(s). --help Show the script help. --lvm Specify the LVM volume group which contains the image(s). --manual Read the manual. --version Show the version number and exit. DESCRIPTION
xen-update-image is a simple script which allows you to update a Xen image of Debian which has been created with xen-create-image. It does this by mounting the image inside a temporary directory then running: apt-get update apt-get upgrade NOTE If the image is already running within Xen this will cause corruption otherwise it will allow you to update your image without booting it. EXAMPLES
The following assumes there are two images which are not currently running. The images are called 'test.my.flat', and 'x11.my.flat'. Updating both images can be accomplished by executing: xen-update-images --dir=/home/xen test.my.flat x11.my.flat AUTHORS
Steve Kemp, http://www.steve.org.uk/ Axel Beckert, http://noone.org/abe/ StA~Xphane Jourdois LICENSE
Copyright (c) 2005-2009 by Steve Kemp, (c) 2010 by The Xen-Tools Development Team. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. 4.3.1 2012-06-30 XEN-UPDATE-IMAGE(8)
All times are GMT -4. The time now is 10:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy