Come Configurare GmailFS: differenze tra le versioni
| Riga 49: | Riga 49: | ||
root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp libgmail.py /usr/lib/python2.4/site-packages/ |
root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp libgmail.py /usr/lib/python2.4/site-packages/ |
||
root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp constants.py /usr/lib/python2.4/site-packages/ |
root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp constants.py /usr/lib/python2.4/site-packages/ |
||
| − | Scaricate gmailfs da http://richard.jones.name/google-hacks/gmailfilesystem/gmailfs-0.7.2.tar.gz |
+ | Scaricate gmailfs da http://richard.jones.name/google-hacks/gmail-filesystem/gmailfs-0.7.2.tar.gz |
Dopo aver scompattato copiate gmailfs.py in /usr/bin. |
Dopo aver scompattato copiate gmailfs.py in /usr/bin. |
||
root@papi:/home/switch/downloads/gmailfs-0.7.2# cp gmailfs.py /usr/bin/ |
root@papi:/home/switch/downloads/gmailfs-0.7.2# cp gmailfs.py /usr/bin/ |
||
Versione attuale delle 17:39, 9 mar 2007
Indice |
[modifica] Introduzione
Mostro qui come creare un filesystem a partire da un account mail di Google Mail. Attenzione, bisogna possedere un account Gmail.
[modifica] Installazione
Controllate se nel vostro sistema avete Python 2.4 installato. Caso mai non l'aveste installato scaricatelo e installatelo ne esiste una versione per ogni distribuzione. Controllate anche di avere installato pyOpenSSL. Caso mai non lo aveste installato lo scaricate da http://pyopenssl.sourceforge.net/ e procedete con l'installazione:
root@papi:/home/switch/downloads# tar xofz pyOpenSSL-0.6.tar.gz root@papi:/home/switch/downloads# cd pyOpenSSL-0.6 root@papi:/home/switch/downloads/pyOpenSSL-0.6# python setup.py build root@papi:/home/switch/downloads/pyOpenSSL-0.6# python setup.py install
Installate fuse scaricabile da: http://fuse.sourceforge.net e procedete con l'installazione:
root@papi:/home/switch/downloads# tar xofz fuse-2.6.0.tar.gz root@papi:/home/switch/downloads# cd fuse-2.6.0 root@papi:/home/switch/downloads/fuse-2.6.0# ./configure --prefix=/usr root@papi:/home/switch/downloads/fuse-2.6.0# make root@papi:/home/switch/downloads/fuse-2.6.0# make check root@papi:/home/switch/downloads/fuse-2.6.0# make install
Caricate il modulo Fuse nel Kernel (da fare ogni volta che si usa GmailFS o metterlo fra i moduli che il kernel deve caricare all'avvio)
root@papi:/home/switch/downloads/fuse-2.6.0# modprobe fuse
Installate Python FUSE indings scaricabile da http://richard.jones.name/google-hacks/gmail-filesystem/fuse-python.tar.gz
Dopo aver scompattato eseguite:
root@papi:/home/switch/downloads/fuse-python# python setup.py build
Deve apparire:
running build running build_py running build_ext
E da root:
root@papi:/home/switch/downloads/fuse-python# python setup.py install
Deve apparire:
running install running build running build_py running build_ext running install_lib copying build/lib.linux-i686-2.4/fuse.py -> /usr/lib/python2.4/site-packages copying build/lib.linux-i686-2.4/_fusemodule.so -> /usr/lib/python2.4/sitepackages byte-compiling /usr/lib/python2.4/site-packages/fuse.py to fuse.pyco
Aprite:
/usr/lib/python2.4/site-packages/fuse.py in un editor di testo: Linea 68
Sostituire:
self.mountpoint = None
con
self.mountpoint = "/mnt/gmailfs"
Scaricate libgmail da http://sourceforge.net/project/showfiles.php?group_id=113492 Dopo averlo scompattato copiate libgmail.py e constants.py in /usr/lib/python2.4/site-packages
root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp libgmail.py /usr/lib/python2.4/site-packages/ root@papi:/home/switch/downloads/libgmail-0.1.5.1# cp constants.py /usr/lib/python2.4/site-packages/
Scaricate gmailfs da http://richard.jones.name/google-hacks/gmail-filesystem/gmailfs-0.7.2.tar.gz Dopo aver scompattato copiate gmailfs.py in /usr/bin.
root@papi:/home/switch/downloads/gmailfs-0.7.2# cp gmailfs.py /usr/bin/
Copiate mount.gmailfs in /sbin/mount.gmailfs e create un link
root@papi:/home/switch/downloads/gmailfs-0.7.2# cp mount.gmailfs /sbin/ root@papi:/home/switch/downloads/gmailfs-0.7.2# cd /sbin root@papi:/sbin# ln -s mount.gmailfs mount.fuse
Copiate gmailfs.conf in /etc/
root@papi:/sbin# cd /home/switch/downloads/gmailfs-0.7.2/ root@papi:/sbin# cp gmailfs.conf /etc/
modificate /etc/gmailfs.conf con il vostro user e pass di gmail
[modifica] Utilizzo
Creare un punto di mount:
root@papi:/sbin# mkdir /mnt/gmailfs
Aggiungete la riga sottostante in /etc/fstab:
/usr/bin/gmailfs.py /mnt/gmailfs gmailfs noauto,username=user,password=pass,fsname=zOlRRa
Sostituite a user il vostro username e a pass la vostra password dell'account Gmail, senza @gmail.com.
[modifica] Montare il filesystem da linea di comando
root@papi:/mnt# mount /mnt/gmailfs Ignored option :rw Ignored option :noexec Ignored option :nosuid Ignored option :nodev Ignored option :user No messages found
[modifica] Controllare lo spazio di Gmail
root@papi:/mnt# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda6 21G 6.5G 14G 33% / /dev/hda5 40G 27G 13G 68% /mnt/dati /dev/hda3 16G 15G 349M 98% /mnt/gentoo /dev/fuse 2.7G 0 11E 0% /mnt/gmailfs
Adesso dentro la directory /mnt/gmailfs potete copiare i vostri file. Quando mandate una grande quantità di dati la scrittura può essere molto lenta in quanto i file si stanno uploadando sul server Gmail.
[modifica] Smontare il filesystem
root@papi:/mnt# umount /mnt/gmailfs
Ora sapete come fare a montare il GmailFS che potrete utilizzare come BackUp
Autore: Switch`