it-artikel:linux:mv-iso2vmwarestorage.sh-verschiebt-automatisch-cd-image-dateien-sofern-vorhanden-an-einen-festen-ort-im-vmware-storage
Differences
This shows you the differences between two versions of the page.
it-artikel:linux:mv-iso2vmwarestorage.sh-verschiebt-automatisch-cd-image-dateien-sofern-vorhanden-an-einen-festen-ort-im-vmware-storage [2022-08-31 12:30] – created - external edit 127.0.0.1 | it-artikel:linux:mv-iso2vmwarestorage.sh-verschiebt-automatisch-cd-image-dateien-sofern-vorhanden-an-einen-festen-ort-im-vmware-storage [2023-01-21 14:45] (current) – removed axel.werner.1973@gmail.com | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== mv-iso2vmwarestorage.sh - Verschiebt automatisch CD-Image-Dateien (sofern vorhanden) an einen festen Ort im VMWARE Storage ====== | ||
- | Ein Administrator will es so einfach und bequem wie irgend möglich haben. Wenn man z.B. öffters unter VMWARE Server neue Betriebsysteme und Boot-CDs ausprobieren möchte und man diese gerne direkt als ISO Image nutzt, möchte ich diese ISO Images ungern jedes mal per FTP oder SCP umständlich hochladen und anschließend auch noch die Filesystem Rechte anpassen müssen wenns auch bequemer mit SAMBA geht. In meinem Fall haben alle Benutzerkonten Homedirectories welche per Default freigegeben sind. d.h. diese Shares sind bereits vorhanden und können als normaler Benutzer genutzt werden. | ||
- | |||
- | Dieses Script (über / | ||
- | |||
- | So kann ich als normaler Benutzer mir bequem ISO Files an einen Ort verschieben lassen an welchem eigentlich nur ROOT zugriff hat. | ||
- | |||
- | --- // | ||
- | |||
- | ===== / | ||
- | < | ||
- | ... | ||
- | # m h dom mon dow user command | ||
- | * * * * * root / | ||
- | ... | ||
- | </ | ||
- | |||
- | |||
- | ===== / | ||
- | < | ||
- | #!/bin/sh | ||
- | ########################### | ||
- | # Script to move ISO Files from one location to another if file is untouched | ||
- | # this script is supposed to be used with cron every minute | ||
- | # | ||
- | # It Requires: fuser and binutils | ||
- | # | ||
- | # | ||
- | # Version 1.02// 2008-12-27 by Axel Werner [mail@awerner.myhome-server.de] | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | VERSION=" | ||
- | |||
- | if [ $# != 2 ]; then | ||
- | echo $VERSION | ||
- | echo " | ||
- | echo "< | ||
- | echo " | ||
- | echo " | ||
- | echo " | ||
- | exit 127 | ||
- | fi | ||
- | |||
- | SOURCE=" | ||
- | DEST=" | ||
- | |||
- | #echo "$0: SOURCE Directory is set to \" | ||
- | #echo "$0: DESTINATION Directory is set to \" | ||
- | |||
- | |||
- | if [ ! -d $DEST ]; then | ||
- | echo $VERSION | ||
- | echo "$0: Destination Directory \" | ||
- | exit 127 | ||
- | fi | ||
- | |||
- | if [ ! -d $SOURCE ]; then | ||
- | echo $VERSION | ||
- | echo "$0: Source Directory \" | ||
- | mkdir -vp $SOURCE | ||
- | chmod ugo+rwx $SOURCE | ||
- | echo "$0: Exiting now, since there is no more work to do for me." | ||
- | exit 127 | ||
- | fi | ||
- | |||
- | for ISOFILE in $SOURCE/ | ||
- | [ -f " | ||
- | echo $VERSION | ||
- | echo "$0: Found ISO File \" | ||
- | echo "$0: Testing if File is untouched yet...(safe to move? | ||
- | INUSE=`fuser $ISOFILE 2>/ | ||
- | if [ " | ||
- | echo "$0: Safe to Move - Moving ISO File to Destination..." | ||
- | mv -vf " | ||
- | else | ||
- | echo "$0: Seems the file is still used by another process. skipping file." | ||
- | fi | ||
- | done | ||
- | |||
- | #echo "$0: All done..." | ||
- | exit 0 | ||
- | |||
- | |||
- | </ | ||
- | |||
- | |||
- | {{tag> |
it-artikel/linux/mv-iso2vmwarestorage.sh-verschiebt-automatisch-cd-image-dateien-sofern-vorhanden-an-einen-festen-ort-im-vmware-storage.1661949019.txt.gz · Last modified: 2022-08-31 12:30 by 127.0.0.1