LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 01-16-2007, 10:19 AM   #1
ignignokt
LQ Newbie
 
Registered: Sep 2006
Posts: 19

Rep: Reputation: 0
How to delete a remote file


I have a script that performs SCP to send files between 2 different servers. I was wondering if there was a way to delete a file on a remote server..any help is appreciated.
 
Old 01-16-2007, 10:20 AM   #2
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 416

Rep: Reputation: 53
Take a look at using rsync over ssh. This should do the trick for you.
 
Old 01-16-2007, 10:21 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint, Tribblix
Posts: 9,731

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
sftp or ssh could do it.
 
Old 01-16-2007, 10:25 AM   #4
ignignokt
LQ Newbie
 
Registered: Sep 2006
Posts: 19

Original Poster
Rep: Reputation: 0
thanks

will rsync just delete 1 file or an entire directory?

Last edited by ignignokt; 01-16-2007 at 10:55 AM.
 
Old 01-16-2007, 10:35 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint, Tribblix
Posts: 9,731

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
You certainly can use ssh without a password, by sharing keys.

http://www.sun.com/bigadmin/content/...h_setting.html

Last edited by jlliagre; 01-16-2007 at 10:37 AM.
 
Old 01-18-2007, 01:13 PM   #6
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 416

Rep: Reputation: 53
Quote:
Originally Posted by ignignokt
will rsync just delete 1 file or an entire directory?
It will delete files or directories that are no longer at the original site... or not. This is selectable in the command switches.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to delete a particular file from tar file majalee Linux - Software 2 07-12-2006 05:53 AM
How to delete once whole files in a remote directory? backpacker Linux - Networking 1 03-10-2006 06:04 AM
Samba - can't delete remote folders ? Caysho Linux - Networking 4 02-04-2006 05:41 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 03:46 AM
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 07:47 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration