Sponsored Content
Full Discussion: main file configuration
Top Forums Shell Programming and Scripting main file configuration Post 302570136 by rahulsxn660 on Wednesday 2nd of November 2011 12:49:03 PM
Old 11-02-2011
main file configuration

I was writing a script that will FTP files to destination folder. All configuration should be done through a properties files and the main script will read the values from the properties file.

the properties file should contain
1) Source folders
2) Source file pattern
3) Destination folder
4) User id
5)remote server url

I have created the structure of the properties file also and the name of the property file would be archieve1.config


Code:
#remoteurl of the machine 
Remoteurl=sfy.waly.com

# your user id 
userid=youruserid


#This is the source directoy from where the files will be picked up
SrcFolders=/home/Administrator/files


#This directory path should end with a slash(/)
DestFolder=/home/Administrator/output/


#the pattern of the files
SourcefilePattern=*.txt

and now the command for sftp which I was using earlier without use of property file was..
Code:
sftp username@host <<EOF
lcd /home/dirA
cd /home/dirB
mput *.txt
exit

Thi above script works perfect and ftp the files from one folder to another within the same server but now I want to make a seprate main script file that will read the properites files as shown above that is from archieve1.config and nothing will be hard coded like username would be read from properties file etc and will sftp files from one folder to another within that server , so how would be the main script file ..please guide me..!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. UNIX for Dummies Questions & Answers

Main UNIX file?

I am restoring data off of a backup tape onto a server I have. The data is coming from an old server I used to have, different IP and different Name. I want to transfer ALL the data from the tape, but yet not have any of my unix network configurations or name settings (on the server itself) to... (3 Replies)
Discussion started by: HandleX
3 Replies

3. Shell Programming and Scripting

configuration file

i am trying to use a configuration file to FTP some files.. i am not sure how to call or use a configuration file in script. can anybody help (5 Replies)
Discussion started by: iamcool
5 Replies

4. Solaris

configuration file

Hi all-interesting forum. I am new with Solaris and i would like your advice on this: I am using a solaris 8 (ultra sparc IIi) workstation at my work,and i am trying to built another one exactly the same-so if the first one fails to have another one as backup. The problem is that the guy who... (1 Reply)
Discussion started by: ioa_pol
1 Replies

5. Shell Programming and Scripting

Configuration File

Hi I need a cofiguration file for my perl script... Suppose my perl script for counting total number of user is #!/usr/bin/perl -w $total_users; #To get how many users currently logged in########### $total_users=`who | wc -l`; print... (2 Replies)
Discussion started by: Harikrishna
2 Replies

6. Shell Programming and Scripting

Delete one Line from Main File and Create another

Hi I need to write a script which will search for some text in some CSV files and will delete the record/line with the matching text and will insert that record/line into some other file. Can you please help? Here is what I want: - Contents of MainFile.csv: - 1,2,3,Loan,4,5,6... (3 Replies)
Discussion started by: kapilk
3 Replies

7. Shell Programming and Scripting

writing the main script file

Hi, I am new to shell scripting,and i was planning to write a script that will move files which have a datetime >= currentdate-N from a source to destination folder. All configuration should be done through a properties files. Here the value of N should be taken as 10 days(modification... (6 Replies)
Discussion started by: rahul125
6 Replies

8. Shell Programming and Scripting

configuration for ftp script in main script

Hi, I am new to shell scripting,and i was planning to write a script that will FTP files to destination folder. I was planning that All configuration should be done through a properties files. and finally the output should be Files are transferred I have developed a properties file named... (4 Replies)
Discussion started by: rahul125
4 Replies

9. Shell Programming and Scripting

Adding header to sub files after splitting the main file using AWK

Hi Folks, I have a file like: mainfile.txt: ------------- file1 abc def xyz file1 aaa pqr xyz file2 lmn ghi xyz file2 bbb tuv xyz I need output having two files file1 and file2. file1: ------ Name State Country abc def xyz aaa pqr xyz file2: (3 Replies)
Discussion started by: tanmay.gemini
3 Replies

10. Shell Programming and Scripting

Retrieving the relevant search from search file in the main file

I have two files: file 1: hello.com neo.com,japan.com,example.com news.net xyz.com, telecom.net, highlands.net, software.com example2.com earth.net, abc.gov.uk file 2: neo.com example.com abc.gov.uk file 2 are the search keys to search in file 1 if any of the search... (7 Replies)
Discussion started by: csim_mohan
7 Replies
APT-CONFIG(8)								APT							     APT-CONFIG(8)

NAME
apt-config - APT Configuration Query program SYNOPSIS
apt-config [-hv] [-o=config string] [-c=file] {[shell] | [dump]} DESCRIPTION
apt-config is an internal program used by various portions of the APT suite to provide consistent configurability. It accesses the main configuration file /etc/apt/apt.conf in a manner that is easy to use by scripted applications. Unless the -h, or --help option is given one of the commands below must be present. shell shell is used to access the configuration information from a shell script. It is given pairs of arguments, the first being a shell variable and the second the configuration value to query. As output it lists a series of shell assignments commands for each present value. In a shell script it should be used like: OPTS="-f" RES=`apt-config shell OPTS MyApp::options` eval $RES This will set the shell environment variable $OPTS to the value of MyApp::options with a default of -f. The configuration item may be postfixed with a /[fdbi]. f returns file names, d returns directories, b returns true or false and i returns an integer. Each of the returns is normalized and verified internally. dump Just show the contents of the configuration space. OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no or several other variations. -h, --help Show a short usage summary. -v, --version Show the program version. -c, --config-file Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information. -o, --option Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options. SEE ALSO
apt.conf(5) DIAGNOSTICS
apt-config returns zero on normal operation, decimal 100 on error. BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. AUTHORS
Jason Gunthorpe APT team NOTES
1. APT bug page http://bugs.debian.org/src:apt Linux 29 February 2004 APT-CONFIG(8)
All times are GMT -4. The time now is 03:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy