我想自动执行本地备份我的 Gmail 帐户的过程,并且正在寻找一种解决方案:
有哪些资源可用于在 Ubuntu 中执行此操作?
Jor*_*tro 25
离线地图
是一个流行的解决方案。
(谷歌的说明)
安装后创建一个 .offlineimaprc
[general]
accounts = GMail
maxsyncaccounts = 3
[Account GMail]
localrepository = Local
remoterepository = Remote
autorefresh = 10 #refresh every 10 minutes
quick = 5 #Quick-syncs do not update if the only changes were to IMAP flags
[Repository Local]
type = Maildir
localfolders = /whatever/directory
[Repository Remote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = your_username@gmail.com
remotepass = your_password
ssl = yes
maxconnections = 1
#Setting realdelete = yes will Really Delete email from the server.
#Otherwise "deleting" a message will just remove any labels and
#retain the message in the All Mail folder.
realdelete = no
Run Code Online (Sandbox Code Playgroud)
然后你需要运行offlineimap。
在某些情况下,一直运行offlineimap会消耗大量内存,特别是如果你有一个大邮箱,那么你可以在cron中添加一个offlineimap check就可以检查然后退出,这里是每日备份:
@daily offlineimap -u Noninteractive.Basic
Run Code Online (Sandbox Code Playgroud)
这些文件将位于您在 localfolders 行中定义为Maildir 的任何内容中。您可以使用您使用的任何备份方法来备份它: