2019-05-11 21:38:21 +00:00
|
|
|
#!/bin/bash
|
2019-05-11 21:30:02 +00:00
|
|
|
#Bash-Library for TerabyteTerminator Project
|
|
|
|
LIBVER=1.1
|
2019-05-11 21:38:21 +00:00
|
|
|
|
|
|
|
{ #set enviroemnt
|
|
|
|
readonly TRUE=1 #like <stdbool.h>
|
|
|
|
readonly FALSE=0 #like <stdbool.h>
|
|
|
|
readonly TTSYNC_EXIST=0 #file exist local
|
|
|
|
readonly TTSYNC_BACKUP=1 #file exist local - backup exist
|
|
|
|
readonly TTSYNC_REMOTE=2 #file exists remote - not used jet
|
|
|
|
readonly TTSYNC_DEL=3 #local file deleted
|
|
|
|
readonly globalconf="/etc/tt/global"
|
|
|
|
[ -z "$DEBUG" ] && readonly DEBUG=$FALSE
|
|
|
|
}
|
2019-05-11 21:43:30 +00:00
|
|
|
|
|
|
|
# file_size <path> -> (du -b)/1024 [Kb]
|
|
|
|
function file_size() {
|
|
|
|
if [ -f "$1" ]; then
|
|
|
|
echo $(($(du -b "$1" | cut -f 1)/1024))
|
|
|
|
else
|
|
|
|
echo 0
|
|
|
|
fi
|
|
|
|
}
|