View unanswered posts | View active topics It is currently Sat Oct 19, 2019 11:45 am



Reply to topic  [ 4 posts ] 
 Delete files using FTP 
Author Message

Joined: Tue Dec 27, 2011 4:40 am
Posts: 2
Reply with quote
Post Delete files using FTP
Hello All,

I'm new to vmware and this forum is saving my life in this project. Thank you guys for that!

I'm not sure if it's the right place to post this question, but here is my doubt:

I have 2 ESXi 4.0 hosts and I need to make a cross backup. I already set up the FTP server in both and configured the ghettoVCB scripts. So far so good.

The problem is that my backups are being uploaded to the other host and the old files are not being deleted. I search around for a FTP command to delete files on the remote host but no luck so far. There is any "native" command or any other program that I can install to do that? Since I can handle the backup rotation on the ghettoVCB, i think a command that delete all the content from the specific folder will work for me.


Tue Dec 27, 2011 4:47 am
Profile
Site Admin

Joined: Mon Mar 16, 2009 10:13 pm
Posts: 3880
Reply with quote
Post Re: Delete files using FTP
When you're in the console you can use rm to delete files and folders. The -f option won't prompt to confirm removal and -r will go through subfolders to delete files.

_________________
Dave Mishchenko
VMware vExpert 2009-2013
Image
Now available - VMware ESXi: Planning, Implementation, and Security
Also available - vSphere Quick Start Guide


Wed Dec 28, 2011 12:17 am
Profile

Joined: Tue Dec 27, 2011 4:40 am
Posts: 2
Reply with quote
Post Re: Delete files using FTP
Hi Dave,

I'm trying to make something to run on the FTP host side, but I was looking for some command to run from the remote host to delete the files. Here is what my script does:

Run GhettoVCB to backup all VMs to a specific folder
tar all files from this folder to backup-<date>.tgz
Upload using FTP the backup-<date>.tgz to the other host.

What I'm trying to do is delete the old backup-<date>.tgz from the remote host after uploading the new one.

It is possible to run SSH commands from the script on the remote host?


Wed Dec 28, 2011 6:11 am
Profile
Site Admin

Joined: Mon Mar 16, 2009 10:13 pm
Posts: 3880
Reply with quote
Post Re: Delete files using FTP
I'm not a scripting expert, but I'd expect you'd be able to run a remote dir command, parse the output for the oldest file and then delete it.

The vghetto script has some code around maintaining a certain number of backup copies so you might be able to leverage that.

_________________
Dave Mishchenko
VMware vExpert 2009-2013
Image
Now available - VMware ESXi: Planning, Implementation, and Security
Also available - vSphere Quick Start Guide


Wed Dec 28, 2011 2:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.