delete files on a remote server


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users delete files on a remote server
# 1  
Old 07-16-2007
delete files on a remote server

Hi Guys,
I am currently working on a script to find all the files that have not been accessed for the past 2 years. This, i guess has been discussed n number of times in this forum. Now, my requirement is to find all the files in the remote windows server. I have it mounted in unix.

I was thinking of doing a rsh to the remote server, find all the files and delete it. This is the command i tried -

rsh -l USER <SERVER> find <TOP LEVEL DIR> -atime <2years> -exec rm -r {} \;

I am getting a permission denied error, which i guess is because i do not have permissions to do an rsh.

My question, Will this command work as expected? Can i do an rsh to the remote windows server and remove the files there?

Are there any other methods of doing this?


Thanks,
Ashwin
# 2  
Old 07-27-2007
you have to configure rsh service in destination server that source server can do the change in server....


Since am using NCR server , i entered hostname of the source server in /etc/hosts.equiv file of destination server.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

3. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

4. Shell Programming and Scripting

how to delete files on two remote servers simultaneously?

dear all, i'm preparing a script which can do these actions : 1. stop remove server's certain service 2. clean the files on remote servers simultaneously (because lots of files need to be deleted) 3. after files/logs are removed, restart the service again i'm stuck on how to clean remote... (4 Replies)
Discussion started by: tiger2000
4 Replies

5. Shell Programming and Scripting

script to delete multiple files in remote machine

Requirement Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know Approach 1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within... (1 Reply)
Discussion started by: vkalya
1 Replies

6. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

7. Shell Programming and Scripting

delete oldest images from remote server

Would someone please give me a script that will remove all but the newest jpg image from my server. i am uploading a new image every 10 seconds form a live web cam Also i do not know who to make a shell script work i am new to all this so i need all the help you could give Thank You very much (1 Reply)
Discussion started by: Destined
1 Replies

8. AIX

Get the list, filter and delete the files on remote server

Hi, I need to login to a remote server. Go to a particular path. Get the lists of files on that path.There may be n number of files. I need to delete only those files from above created list which are 7 days older. I have achieved above using ftp protocol, but now the constraint has... (0 Replies)
Discussion started by: mail_amitnagpal
0 Replies

9. Shell Programming and Scripting

Find files not accessed on a remote server and delete - Help!

Hi Guys, I am currently working on a script to find all the files that have not been accessed for the past 2 years. This, i guess has been discussed n number of times in this forum. Now, my requirement is to find all the files in the remote windows server. I have it mounted in unix. I was... (1 Reply)
Discussion started by: bond_bhai
1 Replies

10. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies
Login or Register to Ask a Question