Created
April 6, 2017 08:53
-
-
Save Neo-Oli/15a3a1f8d31035c454231dc6998cfe43 to your computer and use it in GitHub Desktop.
email backup resore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#creating maildir | |
cd ~/drive/mail | |
mkdir ~/mail | |
#creating directories in maildir | |
for dir in `find -type d`;do | |
if [ "$dir" != "." ];then | |
mkdir "$HOME/mail/$dir" | |
fi | |
done | |
#copying mails, replacing the backup string with colon | |
echo "copying $(find|wc -l) items" | |
for file in `find -type f`;do | |
newfile=${file/"%%%%%"/":"} | |
cp "$HOME/drive/mail/$file" "$HOME/mail/$newfile" | |
echo $file; | |
done|pv -ls $(find|wc -l) - >/dev/null | |
cd $BASEDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment