Copying multiple csv files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copying multiple csv files
# 1  
Old 05-30-2011
Copying multiple csv files

Hi,
I have mutiple csv files at server1 at /apps/test/data.
I needed a script that would copy these csv files from server1 at /usr/data, put them in server2,archive the earlier files that were present in server2 before removing those already present.
Kindly help.
# 2  
Old 05-30-2011
Your requirement isn't clear from these statements. You have mentioned two source directories and it is confusing for us to understand what is needed.

please give us more detail.
# 3  
Old 05-30-2011
just for starting with these short information. All codes are not tested, please run it in your testing environment first.

Code:
log in server1
# backup
find  /apps/test/data -type f -name "*.csv" -exec tar uvf csv.bak.server1.tar {} \;
# scp the tar file to server2
scp csv.bak.server1.tar USERNAME@server2:/usr/data/csv.bak.server1.tar

login server2
#backup on server2.
find /usr/data -type f -name "*.csv" -exec tar uvf csv.bak.server2.tar {} \;
cd /usr/data
tar xvf csv.bak.server1.tar

This User Gave Thanks to rdcwayx For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies

2. Shell Programming and Scripting

Copying the files in to multiple location using shell script

Hi All, i'm trying to copy the 1.txt files (sample files) in to different path location using the below command. But it is not copying the files , when i tried for single location able to copy the file. can any one please assist here. Please find the below path :- /ckr_mkr1/licencekey... (2 Replies)
Discussion started by: venkat918
2 Replies

3. Shell Programming and Scripting

Shell script for connecting multiple servers and then copying 30 days old files

Shell script for connecting multiple servers and then copying 30 days old files from those server . HI , I have 6 multiple servers pla1,pla2,pla3,pla4,pla5,pla6 1. These six servers have common shared mount point /var/share 2. Running script from /var/share to connect these servers.I... (1 Reply)
Discussion started by: rcroyal88
1 Replies

4. Shell Programming and Scripting

Copying multiple files and appending time stamp before file extension

Hi, I have multiple files that read: Asa.txt Bad.txt Gnu.txt And I want to rename them using awk to Asa_ddmmyytt.txt and so on ... If there is a single command or more efficient executable please share! Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies

5. Shell Programming and Scripting

Copying Multiple Files into a Subdirectory

Hello, I'm very new to scripting languages and I'm to use shell script to write a utility to backup files with a specific extension into a subdirectory. Here is what I have done. #!/bin/bash read -p "Enter file(s) extension: " FILE if ; then mkdir `whoami`.$FILE #To... (9 Replies)
Discussion started by: alphanoob
9 Replies

6. UNIX for Dummies Questions & Answers

Help in copying multiple files from th directory

Hey Guys, I have directory with thousands of files, I need to copy only march data. can any one please Help.......... Thanks, Uttam N (4 Replies)
Discussion started by: Uttamnsd
4 Replies

7. SCO

Need advice: Copying large CSV report files off SCO system

I have a SCO Unix server from 1999 running SCO 5.0.5 and some ancient accounting software called Real World A report writer program on the system is used to generate CSV files from accounting that we write with DOSCOPY commands to 3.5" floppies In the next 60 days we will be decommissioning... (11 Replies)
Discussion started by: magnetman
11 Replies

8. UNIX for Dummies Questions & Answers

copying multiple files

We want to copy the data from all the files SPR_201103* to AMGEN. We tried the following command cp $AGENT_DATA/amgen/SPR_201103* $AGENT_DATA/AMGEN amgen is directory . AMGEN is file we are trying to creat. for SPR_201103* 10 files are there Please help me to how to achive this.... (2 Replies)
Discussion started by: ajaykumarkona
2 Replies

9. UNIX for Dummies Questions & Answers

Copying files multiple times increasing sequentially

I am looking for the easiest way to copy a set of files 1000 times and increment sequentially. I want to copy these 2 files: Scenario.1.1.ud Scenario.1.2.ud So that it creates the following: Scenario.2.1.ud Scenario.2.2.ud Scenario.3.1.ud Scenario.3.2.ud .. .. Scenario.1000.1.ud... (2 Replies)
Discussion started by: JPOrlando
2 Replies

10. Shell Programming and Scripting

Synchronization in copying multiple files to a directory

Hi Friends, My goal is to copy 1000 of files of same filesize simultaneously to a directory. i.e i do multiple copies into a same directory. What i feel here is, at some 1000th iteration, few transfers ends in advance before some transfers start. I need to get synchronized file transfers so that... (1 Reply)
Discussion started by: amio
1 Replies
Login or Register to Ask a Question