The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
tnsping at local and remote host? milo Shell Programming and Scripting 1 03-16-2007 11:12 AM
Tar files, transfer to remote host and delelte source Dago SUN Solaris 0 02-28-2006 05:35 PM
local host tamemi UNIX for Dummies Questions & Answers 3 12-23-2003 05:44 PM
Backing up files to a remote host question. WeNdeL UNIX for Dummies Questions & Answers 3 10-02-2002 11:14 AM
local host setup jeremiebarber UNIX for Dummies Questions & Answers 2 03-31-2002 02:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-24-2007
krishna176 krishna176 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 21
Post How to delete the files from local host to remote host

Hi all,

i am copying .gz files from production server to development server using
"scp" command.my requirement is after copying .gz files i want to delete old
.gz files(two days back) in development server from production server.

like this way i need to delelte .log ,.z and .dmp files in development server from production server.

Please let me know if you have any concerns.

could you please help me. i really appriciated.


Regards
Admin
  #2 (permalink)  
Old 03-24-2007
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Using ssh or rsh

Using SSH,

1) Prints the files modified in your local server,

HTML Code:
 ssh -l username localhost "find /dir-path -name '*.gz' -o -name '*.dmp' -o -name '*.z' -mtime +2 -print "
2) Add command to remove them,

HTML Code:
 ssh -l username localhost "find /dir-path -name '*.gz' -o -name '*.dmp' -o -name '*.z' -mtime +2 -ok rm {} "
or
HTML Code:
ssh -l user localhost "find /home/inangan -name '*.gz' -o -name '*.dmp' -o -name '*.log' -mtime +2 | xargs rm -i"
Here mtime +2 signifies the files that are not modified within last 48 hours.

Similary You can also give a try to rsh.

Please let us know if this works.

Thanks,
Nagarajan Ganesan.
  #3 (permalink)  
Old 03-24-2007
krishna176 krishna176 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 21
Thanks alot Nagarajan Ganesan,

one more doubt: shall i delete the files (which are existing already) in develop ment server from production only.


i donot go to development server and delete the files.so i want this whole process is done from production server to development server only.

thanks advance for understanding

regards
krishna
  #4 (permalink)  
Old 03-24-2007
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Yes, you can use rm command in find along with exec or xargs as mentioned in my previous post.Please check the point 2. Also make sure your deleting the correct files in your server.

Thanks,
Nagarajan Ganesan.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0