Stuart wrote:
> smbmount of a PC's remote HDD to /mnt/remotedisk
>
> How do I tell in perl-speak (ie without rewriting the whole thing in
> Java) that the mount point succeeded.
>
> I'm happy to put a file on the remote HDD and search for it's existence
> or some such.
>
> If the mount fails, the root filesystem on the server fills as the
> backup proceeds to /mnt/remotedisk. Aarrrgh.
You've got some excellent pe[a]rls of wisdom, may I give some
advice less specific to perl?
1. Make the (pre-mount) mount point not-writable,
so that you can only write to it when mounted.
This would only work for non-root, since root
can write anywhere.
2. Backup to a _subdirectory_ of the mounted filesystem.
This way you can check the return code of cd or
easily check for the existance of a directory.
idiomatic shell code for copy via tar:
tar cf - /stuff/to/backup | ( cd /place/to/backup/to && tar xf - )
The vital bit here is the && which says to only do the tar xf if
the cd succeeded.
Regards,
Matt
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug