Sponsored Content
Full Discussion: Copy Files with script
Top Forums Shell Programming and Scripting Copy Files with script Post 302580072 by felipe.vinturin on Wednesday 7th of December 2011 11:04:43 AM
Old 12-07-2011
I don't think so!

Inside the while loop you are using "static" variables: CDR_SOURCE and CDR_DEST. Maybe you want this:
Code:
#!/bin/sh

CDR_SOURCE=/storage/archive/logmgmt/result/billing/*
CDR_DEST=/storage4/archive/logmgmt/result/billing/

while read sourcefile destfile
do
cp -arp "${sourcefile}" "${destfile}"
if [ $? -eq 0 ] ; then
         echo "[${destfile}] copied successfully from [${sourcefile}]"
      else
         echo  "ERROR: failed to copy [${destfile}] from ["${sourcefile}"]"
fi
done < /home/xmp/cdrcopy.log

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copy files without password in script

1. I wrote a ftp code to copy a file from unix box to another unix box. But it has clear text password in the code. Due to security constraints, clear text password in the code is not allowed. Please let me know the ways to write the code without prompting for password. 2. I tried writing scp... (0 Replies)
Discussion started by: jwala
0 Replies

2. Shell Programming and Scripting

Trying to copy a TON of files with a script

Ok, here's the problem. I need to copy about 200 GB from an old FreeBSD (5.2.1) server to a new Debian server. The old server's fastest port is the ethernet port. I set up an NFS server on the new machine so I can just copy the files over using regular commands/scripts etc. Thing is, I probably... (4 Replies)
Discussion started by: davidstvz
4 Replies

3. Shell Programming and Scripting

Need a script to copy files and check

Hi all, I need a script in ksh: 1: Copy files from directory (A) to directory (B) 2: Check if files that will be copied in directory (A) have never been yet copied to (B) 3: Never copy the last created file of directory (A) This script will run on crontab. Thanks in advance for your... (1 Reply)
Discussion started by: Camaro
1 Replies

4. Shell Programming and Scripting

shell script to search and copy files

Hello Im new to this forums, I would like some help regarding a script that I need in order to copy some files. Heres the scenario: I need to search several files which have a particular code inside, lets say "test" all of them on different directories. I need to copy all of them on a new... (4 Replies)
Discussion started by: c.watson
4 Replies

5. Shell Programming and Scripting

bash script to copy files

hey everyone, new here i have arch setup and i am using smbnetfs to mount some windows shares in /mnt/smbnet what i want to do is copy files from my home dir to a dir in /mnt/smbnet but i also need it to remove files if i have deleted them from my home dir seems that cp would be the... (8 Replies)
Discussion started by: dodgefan67
8 Replies

6. UNIX for Dummies Questions & Answers

Script to copy files from a certain date

I need to copy files from a directory that has a lot of files in it. However I only want to copy them from a certain date. My thoughts so far are to use ls -l and to pipe this into awk and print out tokens 6 (month)and 7 (day). $ ls -l -rw-r--r-- 1 prodqual tst 681883 Jun 12... (2 Replies)
Discussion started by: millsy5
2 Replies

7. UNIX for Dummies Questions & Answers

Script to search and copy files

HI everyone, I been to this site before for help and found my answers on other threads now I am posting my own :). I have a list of file names with out extensions on an txt file. I need a way for the script to search on the server for each file name and copy the files over to a new directory.... (12 Replies)
Discussion started by: sergiol
12 Replies

8. Shell Programming and Scripting

Need Script to copy the contents of two files into one file

Hi i need Script to copy the contents of two files into one file i have 2 fil X1.txt / X2.txt i need script to copy the contents of X1 and X2 In AllXfile X1.txt File X1 X2.txt File X2 AllXfile.txt File X1 File X2 (2 Replies)
Discussion started by: azzeddine2005
2 Replies

9. Shell Programming and Scripting

Error on script to copy files

Hi I have the following script to copy files from one directory to another: #!/bin/sh touch -mt 201304240000 /var/tmp/ref1 touch -mt 201305152359 /var/tmp/ref2 find /moneta_collected02/in_psl -type f \( -newer /var/tmp/ref1 -a ! -newer /var/tmp/ref2 \) > file_lst cp -pr $(< file_lst)... (6 Replies)
Discussion started by: fretagi
6 Replies

10. UNIX for Dummies Questions & Answers

UNIX ksh Copy Files Script

I need a UNIX ksh script that counts the number of files in directory, if the files exceed 20 files, then email results. I want the script to run every hour.. I don't have access to cron.. I'm some what new to UNIX. Windows guy all my career.. this is what I have so far.. #!/bin/ksh # count.sh ... (5 Replies)
Discussion started by: PerlHaven2k
5 Replies
CFTE(1) 						      General Commands Manual							   CFTE(1)

NAME
cfte - Compiles fte config files SYNOPSIS
cfte sourcefile [destfile] DESCRIPTION
This manual page documents briefly the cfte. This manual page was written for the Debian GNU/Linux distribution (but may be used by others), because the original program does not have a manual page. Instead, it has documentation in html format; see below. cfte compiles the .fterc binary for fte(1) from human readable sources. Example of these source files can be found at /usr/share/doc/fte/config-example.tar.gz. EXAMPLES
cfte /usr/share/doc/fte/config/main.fte compiles the example config tree to fte-new.cnf cfte main.fte ~/.fterc compiles the main.fte (in current directory) to ~/.fterc FILES
~/.fterc Default Configuration file. Includes All keybinding and menus compiled with cfte from config files in /usr/share/doc/fte/con- fig/main.fte. There is a sample .fterc in /etc/fte/system.fterc. *.fte Configuration sources. The syntax of these files is explained in /usr/share/doc/fte/contents.html. SEE ALSO
xfte(1), vfte(1), sfte(1), /usr/share/doc/fte/contents.html AUTHORS
This manual page was written by Riku Voipio and Zdenek Kabelac <riku.voipio@iki.fi> <kabi@debian.org> for the Debian GNU/Linux system. DATE
28 Sep 1999 CFTE(1)
All times are GMT -4. The time now is 05:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy