Add rsync to ranger
This commit is contained in:
parent
9bbbb42a85
commit
1602b84454
@ -17,6 +17,15 @@
|
|||||||
#+HTML_HEAD: <script type="text/javascript" src="./js/readtheorg.js"></script>
|
#+HTML_HEAD: <script type="text/javascript" src="./js/readtheorg.js"></script>
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
|
#+begin_quote
|
||||||
|
%f the highlighted file
|
||||||
|
%d the path of the current directory
|
||||||
|
%s the selected files in the current directory
|
||||||
|
%t all tagged files in the current directory
|
||||||
|
%c the full paths of the currently copied/cut files
|
||||||
|
%p the full paths of selected files
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
* Config
|
* Config
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:header-args: :tangle ~/.config/ranger/rc.conf
|
:header-args: :tangle ~/.config/ranger/rc.conf
|
||||||
@ -201,7 +210,6 @@ Get Bibtex from PDF
|
|||||||
map ,b shell pdf2bib %f
|
map ,b shell pdf2bib %f
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
Delete first page of pdf
|
Delete first page of pdf
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map ,d shell pdf-delete-first-page %f
|
map ,d shell pdf-delete-first-page %f
|
||||||
@ -237,6 +245,11 @@ Print on Rnice
|
|||||||
map ,p shell print-rnice %f &
|
map ,p shell print-rnice %f &
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Backup to NAS
|
||||||
|
#+BEGIN_SRC conf
|
||||||
|
map ,B shell ~/.config/ranger/scripts/backup-to-nas.sh %s &
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Scripts
|
** Scripts
|
||||||
*** Extract Script
|
*** Extract Script
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -267,6 +280,42 @@ Print on Rnice
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
*** Backup to NAS
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :tangle ~/.config/ranger/scripts/backup-to-nas.sh
|
||||||
|
:header-args+: :comments both :mkdirp yes
|
||||||
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
|
:END:
|
||||||
|
|
||||||
|
- Arguments are the files to be backup to the NAS
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
if [ $TMUX ]; then
|
||||||
|
tmux split -v -l 2 rsync -a --info=progress2 --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/ && tmux select-pane -U
|
||||||
|
else
|
||||||
|
rsync -a --info=progress2 --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Paste with Rsync
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args: :tangle ~/.config/ranger/scripts/paste-rsync.sh
|
||||||
|
:header-args+: :comments both :mkdirp yes
|
||||||
|
:header-args+: :shebang "#!/usr/bin/env bash"
|
||||||
|
:END:
|
||||||
|
|
||||||
|
- First argument is the directory where to copy files
|
||||||
|
- All other arguments are files that are to be copied
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
if [ $TMUX ]; then
|
||||||
|
tmux split -v -l 1 rsync -a --info=progress2 ${@:2} $1 && tmux select-pane -U
|
||||||
|
else
|
||||||
|
rsync -a --info=progress2 ${@:2} $1
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
** Define keys for the browser
|
** Define keys for the browser
|
||||||
*** Basic
|
*** Basic
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
@ -406,6 +455,11 @@ Print on Rnice
|
|||||||
map pht paste_hardlinked_subtree
|
map pht paste_hardlinked_subtree
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Paste with Rsync
|
||||||
|
#+BEGIN_SRC conf
|
||||||
|
map pr shell ~/.config/ranger/scripts/paste-rsync.sh %d %c
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
*** Delete and move files
|
*** Delete and move files
|
||||||
#+BEGIN_SRC conf
|
#+BEGIN_SRC conf
|
||||||
map dD shell -s trash-put %s
|
map dD shell -s trash-put %s
|
||||||
|
Loading…
Reference in New Issue
Block a user