web-dev-qa-db-ja.com

Firefoxのブックマークやその他の個人ファイルのbashスクリプトをバックアップする

個人用デスクトップ用にWindowsからUbuntuに移行していますが、Firefoxのブックマークや個人用ドキュメントなどの個人データをバックアップする簡単な方法を知りたいです...

Windowsではすべてを手動でコピーしていますが、Ubuntuでは自動的にコピーするbashスクリプトを作成したいと思います。

私は、ファイルを作成して実行可能にすることと、この簡単な例以外に、bashスクリプトの知識がありません。

#!/bin/bash
cp /files/file.doc /media/flashdrive/

現在のプロファイルを自動的に検出するにはどうすればよいですか? (現在、コンピューターには3つのプロファイルがあります。1つは使用しないプロファイル、もう1つはブックマークのない妻用、そして私のプロファイルです)。

12
fred

rsync (Ubuntuの場合)を使用することをお勧めします。

数百メガのデータがある場合は、変更したデータのみを同期/バックアップすることをお勧めします。これにより、バックアップ速度が向上します。

ホストのような他のファイルのように、あなたは単にcpすることができます

Firefoxの場合、使用しているプロファイルをprofiles.iniから見つける必要があります。その後、bookmarks.htmlをコピーできます。

Grepを使用して、profiles.iniが使用するフォルダーを確認できます。

grep Path ~/.mozilla/firefox/profiles.ini

それは出力します:

Path=e8tog617.default

次に、Path=を削除します

sed "s/Path=//g"

Backup.shは次のようになります。

rsync -rltDqv ~/Documents/ /media/flashdrive/Documents/
cp ~/.mozilla/firefox/`grep Path ~/.mozilla/firefox/profiles.ini | sed "s/Path=//g"`/bookmarks.html /media/flashdrive/bookmarks.html
cp /etc/hosts /media/flashdrive/hosts

ここで、chmod +x backup.shを実行してから、./backupを実行します。

18
Book Of Zeus

Firefoxの場合、Firefoxの「同期」機能を使用してプロファイルを同期できると思います。

バックアップドキュメントの場合は、unisonやFreeFileSyncなどのソフトウェアを試すこともできます。

2
Chen Xing

プロファイルを手動でバックアップする

ファイルやフォルダのコピーに慣れている場合は、プロファイルを手動でバックアップできます。このプロセスは、単一のディレクトリをバックアップ場所にコピーするのと同じくらい簡単です。ほとんどの作業は、プロファイルフォルダが保存されている場所を見つけることです。

It's a good idea to first get rid of any unnecessary files to reduce the size of your backup.
    Firefox: " Tools -> Options-> Advanced -> Network -> (under Offline Storage or Cached Web Content) -> Clear Now"
    Mozilla Suite/SeaMonkey: Edit -> Preferences -> Advanced -> Cache -> Clear Cache, as well as compact your mail.
    Thunderbird: Compact your mail. 
Completely exit or quit the application. Mozilla Suite and SeaMonkey 1.x users on Windows should also exit Mozilla Quick Launch if its enabled.
Find the "Mozilla" (for Mozilla Suite/SeaMonkey 1.x), "SeaMonkey" (for SeaMonkey 2), "Firefox", or "Thunderbird" folder in the profile folder path that contains the registry.dat file or profiles.ini file and the "Profiles" folder (Windows and Mac) or <profile name> folder (Linux). See Profile folder - Firefox , Profile folder - Thunderbird and Profile folder - SeaMonkey for the location.
Copy the "Mozilla" "SeaMonkey" "Firefox" or "Thunderbird" folder to the backup location. This will back up all profiles in the default location and the "registry.dat" or "profiles.ini" file that keeps track profiles.
If you have created any profiles in a custom location, copy them to the backup location and make a note of the original location. 

メールはデフォルトでプロファイル内に保存されます。プロファイルの外部にアカウントメッセージを保存するようにThunderbird、Mozilla Suite、またはSeaMonkeyを再構成した場合は、そのアカウントの「ローカルディレクトリ」もコピーする必要があります。アカウント設定を調べて、各アカウントのローカルディレクトリの場所を見つけます。 [編集]プロファイルを手動で復元する

プロファイルのバックアップを復元するには:

Close the application whose profile you're going to restore. If you're using Mozilla Suite or SeaMonkey 1.x you should also exit Mozilla Quick Launch if its enabled.
Copy each folder you backed up to the exact same location that it was in when you made the backup
0
Shankar