Script for transferring files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script for transferring files
# 1  
Old 11-08-2012
Script for transferring files

Hi Guys,
I have to transfer a few files in my system . The commands to be used are as follows . Will it be possible to send the output of the following in the form of a mail .
Code:
cd /export/home/teja
ls -lrt Quote.java*
mv Quote.java Quote.java.20121023
cp /tmp/Quote.java .
ls -lrt ACSOESaveQuote.java*

The output displayed on the screen when the above commands are run should be copied to a file and sent via mail .
Can you please advice on this .

Last edited by Franklin52; 11-09-2012 at 05:05 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 11-08-2012
Not sure if this is what you are looking for:-
Code:
# cat mail_cmds.sh
{
 cd /export/home/teja
 ls -lrt Quote.java*
 mv Quote.java Quote.java.20121023
 cp /tmp/Quote.java .
 ls -lrt ACSOESaveQuote.java* 
} > out_cmds.txt

mailx -s "Command O/P" user@domain.com < out_cmds.txt

This User Gave Thanks to Yoda For This Post:
# 3  
Old 11-09-2012
Thanks a lot Bipinajith ....
It worked perfectly ..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Transferring files to directories

I have a large number of files with file names of the format iv.epoz.hhe.d.2018.028.000000.sac iv.epoz.hhn.d.2018.028.000000.sac iv.epoz.hhz.d.2018.028.000000.sac iv.epoz.hhe.d.2018.029.000000.sac iv.epoz.hhn.d.2018.029.000000.sac iv.epoz.hhz.d.2018.029.000000.sac... (4 Replies)
Discussion started by: kristinu
4 Replies

2. AIX

Rcp error while transferring files

i am trying to use a rsh script that uses the rcp command to copy files from server to server but it always produce the following error: HOSTNAME: protocol failure due to unexpected closure from server end Error: failed to copy /test to HOST2 system Error: failed to execute command on remote... (5 Replies)
Discussion started by: Portabello
5 Replies

3. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

4. UNIX for Dummies Questions & Answers

Transferring files from one linux server into another

Hello , I want to transfer files from one linux server into another , I got it working using SCP command , but I have to type in password for each and every file . All the remote severs have the same password , so is there a way that I can transfer all these files by typing my password only once ? (5 Replies)
Discussion started by: RaviTej
5 Replies

5. Shell Programming and Scripting

Transferring Files via ssh (bash)

I am trying to transfer my website using ssh(hostbasedauthentication) using: sudo ssh -o "PasswordAuthentication no" -o "HostbasedAuthentication yes" -l testuser 192.168.3.1 "find /var/www/vhosts/mywebsite.com -depth | grep -f include| cpio -oavc| gzip" > $backup_dir/fullwwwsite$date.cpio.gz ... (5 Replies)
Discussion started by: metallica1973
5 Replies

6. UNIX for Dummies Questions & Answers

Mget issue: not transferring more than 2 files

I am trying to transfer about 3000 files from a window platfrom to my linux server. the scrip is pretty simple ftp to the source server (windows) cd to source directory lcd to destination directory mget *.jpg what I get in the log file is: mget 07421001.jpg? 200 PORT command successful.... (4 Replies)
Discussion started by: Doveman
4 Replies

7. AIX

Transferring files via RS232 cable

Current setup: Some old AIX standalone machine (F series) My WinXP laptop Null modem cable from laptop to AIX machine (console port). On Hypterminal on WinXP I can connect to the AIX machine (serial connection), but when I try to transfer file, it will just sit there. I'm guessing the... (3 Replies)
Discussion started by: apra143
3 Replies

8. AIX

Transferring files between Windows and AIX

How do I transfer Plain Text and/or BMP image files between my WindowsXP PC and my AIX 4.1 PowerPC? I have no network or USB options, just a Floppy disk drive and a CD drive on each machine. Is it possible at all? Any help would be gratefully received:) (7 Replies)
Discussion started by: Pennant Man
7 Replies

9. UNIX for Dummies Questions & Answers

Transferring hidden files with scp

Is there a way to scp hidden files only ( with regex ) without specifying the name of the hidden files ? Many thanks in advance ! :) (13 Replies)
Discussion started by: matrixmadhan
13 Replies

10. UNIX for Dummies Questions & Answers

transferring files to and from remote computer

Hi all, i first have to ssh into my university account and then through there another ssh into my office computer, from my home computer. I have been trying to transfer files to and from with no such luck. How do i send a file from home to my office computer. Do I have to send it to my... (6 Replies)
Discussion started by: yogi1
6 Replies
Login or Register to Ask a Question