![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
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 " HTML Code:
ssh -l username localhost "find /dir-path -name '*.gz' -o -name '*.dmp' -o -name '*.z' -mtime +2 -ok rm {} "
HTML Code:
ssh -l user localhost "find /home/inangan -name '*.gz' -o -name '*.dmp' -o -name '*.log' -mtime +2 | xargs rm -i" Similary You can also give a try to rsh. Please let us know if this works. Thanks, Nagarajan Ganesan. |
|
||||
|
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 |
|
||||
|
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 | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|