Added experimental unison syncing commands

This commit is contained in:
Austen Adler 2014-07-17 01:50:43 -04:00
parent 2ef92e8a78
commit e3d89ba535
6 changed files with 28 additions and 11 deletions

View File

@ -1,4 +1,4 @@
while getopts ":hbsdtclw" VALUE "$@"; do
while getopts ":hbsdtclwu" VALUE "$@"; do
if [ "$VALUE" = "h" ] ; then
echo "sync.sh syncs configuration files, applications, and Vim bundles between computers"
echo " -h Shows this help"
@ -83,5 +83,11 @@ while getopts ":hbsdtclw" VALUE "$@"; do
sudo vi `which wemux` +"execute \"normal gg/tmux\<CR>nnnea -2\<Esc>nea -2\<Esc>ggZZ\""
sudo vi /usr/local/etc/wemux.conf +":execute \"normal gg/host_list\<CR>nnww\""
fi
if [ "$VALUE" = "u" ] ; then
sudo cp unison/unisonNetworkOnPortForward.sh /etc/network/if-up.d/
sudo vim /etc/rc.local +"execute \"normal /exit 0\<CR>Osudo -u stonewareslord ${PWD}/unison/unisonMonitor.sh &\<Esc>ggZZ\""
vim unison/unisonSync.sh +"execute \"gg/sync<CR>\$hci\"${PWD}\<Esc>ggZZ\""
echo "30 12 * * * ${PWD}/unison/unisonSync.sh" >> /etc/cron.d/unison
fi
done
echo "Done syncing"

2
unison/unisonKill.sh Normal file
View File

@ -0,0 +1,2 @@
#! /bin/bash
ps aux | grep unison | awk '{print $2}' | xargs kill -9

2
unison/unisonMonitor.sh Normal file
View File

@ -0,0 +1,2 @@
#! /bin/bash
unison default ~/Documents ssh://stonewareslord@localhost:9922//home/vinh/Backup/Documents -repeat watch -times -logfile /tmp/unison.log

View File

@ -0,0 +1,2 @@
#! /bin/bash
sudo -u stonewareslord ssh stonewareslord@austenwares.com -Y -C -f -N -L 9922:austenwares.com:22

3
unison/unisonSync.sh Normal file
View File

@ -0,0 +1,3 @@
#! /bin/bash
sync="~/applications/sync/"
unison -batch -times $SYNC ssh://stonewareslord@localhost:9922//home/stonewareslord/unison/sync -logfile /tmp/unison.log

20
vimrc
View File

@ -18,7 +18,7 @@ nnoremap <C-d> <C-w>q
nnoremap <F3> :!make&&echo "Uploading robot code";wput ./PPC603gnu/src/Debug/src.out ftp://frc:frc@10.20.59.2/ni-rt/system/FRC_UserProgram.out<CR>
nnoremap G G$
vnoremap G G$
nnoremap <F6> :GundoToggle<CR>
nnoremap <F5> :GundoToggle<CR>
nnoremap <F8> :TagbarToggle<CR>
nnoremap + <C-a>
nnoremap - <C-x>
@ -56,7 +56,7 @@ vnoremap <silent> # :call VisualSelection('b')<CR>
nnoremap <BS> :nohlsearch<CR>g<C-g>zo
nnoremap U <C-r>
nnoremap K i<CR><Esc>k$
nnoremap <Enter> :w<CR>g<C-g>
nnoremap <Enter> :up<CR>g<C-g>
"nnoremap s c
vnoremap gj j
vnoremap gk k
@ -108,6 +108,7 @@ nnoremap <Down> <C-w>W
nnoremap <Left> :bp<CR>
nnoremap <Right> :bn<CR>
nnoremap <C-w>z <C-w>_<C-w>|
nnoremap <Leader>bn G?Bundle<CR>yyp$hdi'"+gP0Wl3d/\/<CR>x:nohlsearch<CR>:up<CR>:BundleInstall
nmap <C-Up> [e
nmap <C-Down> ]e
vmap <C-Up> [egv
@ -182,6 +183,13 @@ let g:php_refactor_command='php /usr/local/bin/refactor.phar'
let loaded_matchit = 1
filetype off
call vundle#rc()
"Bundle 'Floobits/floobits-vim'
"Bundle 'tsaleh/vim-matchit'
"Bundle 'Shougo/neosnippet'
"Bundle 'honza/vim-snippets'
"Bundle 'msanders/snipmate.vim'
"Bundle 'vim-scripts/YankRing.vim'
"Bundle 'majutsushi/tagbar'
Bundle 'gmarik/vundle'
Bundle 'Chiel92/vim-autoformat'
Bundle 'tpope/vim-surround'
@ -212,13 +220,7 @@ Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-unimpaired'
Bundle 'kien/ctrlp.vim'
Bundle 'godlygeek/tabular'
"Bundle 'Floobits/floobits-vim'
"Bundle 'tsaleh/vim-matchit'
"Bundle 'Shougo/neosnippet'
"Bundle 'honza/vim-snippets'
"Bundle 'msanders/snipmate.vim'
"Bundle 'vim-scripts/YankRing.vim'
"Bundle 'majutsushi/tagbar'
Bundle 'tpope/vim-abolish'
filetype plugin indent on
if exists("+undofile")
if isdirectory($HOME . '/.vim/undo') == 0