added first version of rsync script
This commit is contained in:
parent
ad4fc5f138
commit
803489adbd
1 changed files with 30 additions and 0 deletions
30
bash/sync
Executable file
30
bash/sync
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
|
||||
HOME_DIR=/home/stv0g
|
||||
HOST=sea
|
||||
MAX_SIZE=500 # Mbytes
|
||||
|
||||
find $HOME_DIR -type f -size +$(($MAX_SIZE*1024))k > $HOME_DIR/rsync.large.exclude
|
||||
|
||||
touch $HOME_DIR/rsync.log
|
||||
echo started: $(date) | tee $HOME_DIR/rsync.log
|
||||
|
||||
rsync \
|
||||
--human-readable \
|
||||
--exclude-from=$HOME_DIR/rsync.exclude \
|
||||
--exclude-from=$HOME_DIR/rsync.large.exclude \
|
||||
--archive \
|
||||
--xattrs \
|
||||
--delete \
|
||||
--executability \
|
||||
--links \
|
||||
--compress \
|
||||
--progress \
|
||||
--max-size=$MAX_SIZE \
|
||||
$HOME_DIR/ $HOST:$HOME_DIR/backup/ \
|
||||
2>&1 | tee -a $HOME_DIR/rsync.log
|
||||
|
||||
echo finished: $(date) | tee -a $HOME_DIR/rsync.log
|
||||
|
||||
# resync logfile
|
||||
scp $HOME_DIR/rsync.log $HOST:$HOME_DIR/backup/
|
Loading…
Add table
Reference in a new issue