Skip to content

Commit

Permalink
new backup 2024-01-05 20:51:19
Browse files Browse the repository at this point in the history
  • Loading branch information
laspavel committed Jan 5, 2024
1 parent 97f4c9e commit 51e20d6
Show file tree
Hide file tree
Showing 33 changed files with 3,683 additions and 225 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2,619 changes: 2,619 additions & 0 deletions .config/doublecmd/colors.json

Large diffs are not rendered by default.

892 changes: 892 additions & 0 deletions .config/doublecmd/doublecmd.xml

Large diffs are not rendered by default.

File renamed without changes.
6 changes: 3 additions & 3 deletions src/.config/mc/ini → .config/mc/ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ filepos_max_saved_entries=1024

[Layout]
output_lines=0
left_panel_size=95
left_panel_size=60
top_panel_size=12
message_visible=true
keybar_visible=true
Expand Down Expand Up @@ -172,7 +172,7 @@ ignore_dirs=
follow_symlinks=false

[Panelize]
Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print
Modified git files=git ls-files --modified
Find rejects after patching=find . -name \\*.rej -print
Find *.orig after patching=find . -name \\*.orig -print
Modified git files=git ls-files --modified
Find SUID and SGID programs=find . \\( \\( -perm -04000 -a -perm /011 \\) -o \\( -perm -02000 -a -perm /01 \\) \\) -print
2 changes: 1 addition & 1 deletion src/.config/mc/panels.ini → .config/mc/panels.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ filter_flags=7

[Dirs]
current_is_left=false
other_dir=/home/laspavel/_
other_dir=/home/laspavel/_/dotfiles
File renamed without changes.
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ __pycache__/
*.py[cod]
certs/

*~

# mac
.DS_Store

Expand Down Expand Up @@ -120,3 +122,44 @@ venv.bak/
#Passfile
.pass
hcloud.pass

# ----------------------------------------------------------------------
# | Miscellaneous |
# ----------------------------------------------------------------------

# Node.js, npm, and yarn.

node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*


# ----------------------------------------------------------------------
# | macOS |
# ----------------------------------------------------------------------

.AppleDouble
.DS_Store
.localized
.LSOverride
.Spotlight-V100
.Trashes

# ----------------------------------------------------------------------
# | Vim |
# ----------------------------------------------------------------------

%*
*.sw[a-z]
*.un~
.netrwhist
Session.vim

# ----------------------------------------------------------------------
# | Windows |
# ----------------------------------------------------------------------

Desktop.ini
ehthumbs.db
Thumbs.db
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added DOD1/.bash_history.zip
Binary file not shown.
File renamed without changes.
Binary file added DOD1/.ssh.zip
Binary file not shown.
Binary file renamed src/DOD1/.tmux.zip → DOD1/.tmux.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ force-check-update=true
group-apps=false
group-apps-label-font-color='#dddddd'
group-apps-label-font-color-minimized='#dddddd'
group-apps-label-max-width=75
group-apps-label-max-width=55
group-apps-underline-unfocused=true
group-apps-use-fixed-width=false
group-apps-use-launchers=false
Expand Down
Binary file added DOD1/dump_gnome_settings.zip
Binary file not shown.
File renamed without changes.
File renamed without changes.
54 changes: 0 additions & 54 deletions backup.sh

This file was deleted.

124 changes: 124 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/bin/bash

# To cron: 00 14 * * * laspavel cd /home/laspavel/_/dotfiles/ && ./bootstrap.sh --backup

function RestoreDotFiles() {
if which git >/dev/null 2>&1; then
# save old global git config
OLDMASK=$(umask)
umask 0077
git config --global -l | LANG=C sort > .oldgit$$.tmp
umask $OLDMASK
fi

OS='rpm_compat' # default to RPM compatible
if [ -d /etc/apt/sources.list.d/ ]; then
OS='deb_compat'
fi

if which rsync >/dev/null 2>&1; then
echo "Rsync found - OK ! "
else
if [ "$OS" == "deb_compat" ]; then
apt-get update
apt-get -y install rsync
fi
if [ "$OS" == "rpm_compat" ]; then
yum -y install rsync
fi
fi

if which rsync >/dev/null 2>&1; then
rsync --exclude ".git/" \
--exclude "bootstrap.sh" \
--exclude "README.md" \
--exclude "LICENSE" \
-avh --no-perms . ~;
else
echo "Rsync not installed... Copy aborted !"
fi
}

function BackupDotFiles () {
STARTDIR="$(pwd)"
PASS=`cat .pass`
DATE=`date '+%Y-%m-%d %H:%M:%S'`
mkdir -p $STARTDIR/DOD1

OS='rpm_compat' # default to RPM compatible
if [ -d /etc/apt/sources.list.d/ ]; then
OS='deb_compat'
fi

if which zip >/dev/null 2>&1; then
echo "ZIP found - OK ! "
else
if [ "$OS" == "deb_compat" ]; then
apt-get update
apt-get -y install zip
fi
if [ "$OS" == "rpm_compat" ]; then
yum -y install zip
fi
fi

#### dconf load /org/gnome/shell/extensions/dash-to-panel/ < dash_to_panel_settings
if which dconf >/dev/null 2>&1; then
dconf dump /org/gnome/shell/extensions/dash-to-panel/ > $STARTDIR/DOD1/dash_to_panel_settings
dconf dump /org/gnome/terminal/ > $STARTDIR/DOD1/gnome_terminal_settings
dconf dump / > $STARTDIR/DOD1/dump_gnome_settings
fi
if which pip3 >/dev/null 2>&1; then
pip3 freeze > $STARTDIR/DOD1/pip3_packages.txt
fi

mkdir -p $STARTDIR/.config/mc
cp -rf ~/.config/mc/ini $STARTDIR/.config/mc/ini
cp -rf ~/.config/mc/panels.ini $STARTDIR/.config/mc/panels.ini
mkdir -p $STARTDIR/.config/doublecmd
cp -rf ~/.config/doublecmd/colors.json $STARTDIR/.config/doublecmd/colors.json
cp -rf ~/.config/doublecmd/doublecmd.xml $STARTDIR/.config/doublecmd/doublecmd.xml
mkdir -p $STARTDIR/.config/htop
cp -rf ~/.config/htop/htoprc $STARTDIR/.config/htop/htoprc
cp -rf ~/.vimrc $STARTDIR
cp -rf ~/.toprc $STARTDIR
cp -rf ~/.tigrc $STARTDIR
cp -rf ~/.wgetrc $STARTDIR
cp -rf ~/.psqlrc $STARTDIR
cp -rf ~/.tmux $STARTDIR/DOD1
cp -rf ~/.python_history $STARTDIR/DOD1
cp -rf ~/.nanorc $STARTDIR
cp -rf ~/.lesshst $STARTDIR
cp -rf ~/.gitconfig $STARTDIR
cp -rf ~/.gitignore $STARTDIR
cp -rf ~/.laspavelrc $STARTDIR
cp -rf ~/.bash_profile $STARTDIR
cp -rf ~/.bash_logout $STARTDIR
cp -rf ~/.bash_history $STARTDIR/DOD1
cp -rf ~/.ssh $STARTDIR/DOD1

cd $STARTDIR/DOD1
zip -P$PASS -9 -q -r -m ./.ssh.zip ./.ssh
zip -P$PASS -9 -q -r -m ./.tmux.zip ./.tmux
zip -P$PASS -9 -q -r -m ./.bash_history.zip ./.bash_history
zip -P$PASS -9 -q -r -m ./.python_history.zip ./.python_history
zip -P$PASS -9 -q -r -m ./dump_gnome_settings.zip ./dump_gnome_settings

cd $STARTDIR
git add .
git commit -a -m "new backup $DATE"
# git push origin --all
# git push --tags
}

if [ "$1" == "--backup" -o "$1" == "-b" ]; then
BackupDotFiles;
else
RestoreDotFiles;
fi;
unset BackupDotFiles;
unset RestoreDotFiles;




1 change: 0 additions & 1 deletion cron/backup_dotfiles

This file was deleted.

Loading

0 comments on commit 51e20d6

Please sign in to comment.