Re: [Samba] HowTo clear a share using smbclient ?
- Date: Thu, 15 May 2008 09:15:06 +0800
- From: Michael Heydon <michaelh@xxxxxxxxxxxxx>
- Subject: Re: [Samba] HowTo clear a share using smbclient ?
This seems a bit Rube Goldberg to me, you have direct access to the file system, why not use it?
If you are really worried that rm -rf /full/path/to/directory might somehow morph into rm -rf / you could do something like:
su nobody -c rm -rf /full/path/to/directoryIn the event that it did try to delete / it would be limited to files writable by "nobody".
I understand being cautious around rm -rf especially when running as root, but I think testing and being careful are a better solution than using samba to limit access.
Jon Wilson wrote:
Good Evening, I was wondering if anyone knows how to clear a share on a server using a command line interface ? Basically I have a [public] share that I would like cleared down every night, I've worked out that smbclient //apps-srv/public -N -c "del *" > /var/log/samba_public_delete.log 2>&1 seems to go most of the way to doing what I want - however it doesn't delete subdirectories. Is there any easy way to accomplish this ? I prefer the idea of running this rather than a 'rm -rf' from the command line as I can script this and as it's a public share the possibility of deleting anything else is pretty minimal. I've seen a few examples of wayward rm command in crons to be wary of doing that ! Any ideas how I could accomplish this ? Many Thanks Jon
-- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
- Follow-Ups:
- Re: [Samba] HowTo clear a share using smbclient ?
- From: Charlie
- Re: [Samba] HowTo clear a share using smbclient ?
- References:
- [Samba] HowTo clear a share using smbclient ?
- From: Jon Wilson
- [Samba] HowTo clear a share using smbclient ?
- Prev by Date: Re: [Samba] monitoring file access levels?
- Next by Date: Re: [Samba] monitoring file access levels?
- Previous by thread: [Samba] HowTo clear a share using smbclient ?
- Next by thread: Re: [Samba] HowTo clear a share using smbclient ?
- Index(es):