Sponsored Content
Full Discussion: Script to Push Files
Top Forums Shell Programming and Scripting Script to Push Files Post 302928566 by gkelly1117 on Friday 12th of December 2014 05:11:21 PM
Old 12-12-2014
Script to Push Files

Hey Guys, Thanks for always being helpful, I have another issue that I need a little insight on how to fix.

See the below script I have and the error I get. I don't understand why it does that, am I not using the continue correctly?

Code:
#!/bin/bash -x
# @(#) File: filepush.sh
# ---------------------------------------------------------------------------
# Modication History:
# Date       Name                       Description
# 12/10/2014  Emmanuel Iroanya          Script to copy a file to all hosts listed in serverlist file
# ---------------------------------------------------------------------------

source /opt/mgr/conf/file.conf
source /opt/mgr/conf/dest.conf
HOSTS=/opt/mgr/conf/$1serverlist.conf

echo "Are you sure you want to copy $file to the list of $1 servers"
echo "This may take a while!!"
echo -n "Enter 'y' or 'n':"
read CHOICE
case "$CHOICE" in
        y|yes|Yes) while read line
do
        ssh "$line" "mkdir -p $dest" && scp -r "$file" "$line:$dest"
done < $HOSTS
        continue ;;
     n|no|No) echo "Please try again later"

esac

Code:
./filepush: line 30: continue: only meaningful in a `for', `while', or `until' loop

 

7 More Discussions You Might Find Interesting

1. Linux

FTP push

Hi I am trying to send a file form one linux server into an another linux server. I cannot do ftp get. Can anyone please assist me how can I push the file to the other server ? Thanks. (2 Replies)
Discussion started by: sureshcisco
2 Replies

2. Shell Programming and Scripting

How can I push an X app to the front by PID?

I'm trying to write a script that will start an X application if it's not already running, but will find it and pop it to the front if it is already running (maybe it's lost on a busy desktop). Is there such a mechanism? Here is part of the logic: VRDP="$(ps ax|grep "rdesktop .*... (3 Replies)
Discussion started by: KenJackson
3 Replies

3. Shell Programming and Scripting

push and pop directories and subdirectories

I need to use pushd and popd to navigate all of the subdirectories in my current directory. I know how to get into each subdirectory, add it to the stack, and pop back out, but i cant figure out how to get into subdirectories deeper than the first without adding a foreach and if statement for... (1 Reply)
Discussion started by: ollie88r
1 Replies

4. UNIX for Dummies Questions & Answers

Rsync push or pull?

We have a cluster of 3 web servers. I'll be updating a single master server and copying info to the other 2 slave servers. What's the best way of synching all of them? Run rsync on each of the slave servers to pull the updates from the master? Or run rsync on the master to push the updates to the... (1 Reply)
Discussion started by: gaspol
1 Replies

5. UNIX for Dummies Questions & Answers

Setup a push script from NIS

Hi guys, can we get a pushed script for every NIS client like a policy.? I need to set a symbolic links for for every client. Thanks ... (1 Reply)
Discussion started by: pianz
1 Replies

6. Homework & Coursework Questions

Need help with a Perl Script using Pop, Shift, & Push

Hello everyone, I am new to Perl and I am having some issues getting a script to work. I have to create a script that uses an array of 52 cards, "shuffles" the cards (using loops with the pop, shift, and push commands), and prints out the top five. This is not a randomizing of the array just a... (2 Replies)
Discussion started by: Hax0rc1ph3r
2 Replies

7. Shell Programming and Scripting

Help on a script to push files once a day

Hello! Please I need some help on writing a script to push files from one server to the other once a day, everyday. I know that I can use this script on a crontab to send the files , but I am not sure how to start writing it, the actual script. I could start by declaring some variables: ... (4 Replies)
Discussion started by: fretagi
4 Replies
logadm.conf(4)							   File Formats 						    logadm.conf(4)

NAME
logadm.conf - configuration file for logadm command SYNOPSIS
/etc/logadm.conf DESCRIPTION
/etc/logadm.conf is the default configuration file for the log management tool logadm(1M). Comments are allowed using the pound character (#) and extend to the end of line. Each non-comment line has the form: logname options where logname is the name of the entry and options are the default command line options for the logadm command. The name of the entry may be the same as the name of the log file, or a log file name may be given in the options section of the entry. Long lines may be folded using a backslash followed by a newline to continue an entry on the next line. Single or double quotes may be used to protect spaces or alternate-style quotes in strings. The preferred method for changing /etc/logadm.conf is to use the -V, -w, and -r options to the logadm(1M) command, which allow you to lookup an entry, write an entry, or remove an entry from /etc/logadm.conf. A full description of how and when /etc/logadm.conf is used and sample entries are found in logadm(1M). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsr | +-----------------------------+-----------------------------+ SEE ALSO
logadm(1M), attributes(5) SunOS 5.10 6 Dec 2001 logadm.conf(4)
All times are GMT -4. The time now is 06:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy