I need to backup data from a web server with 10GB of RAM (Ubuntu). To backup data I use Rsync.
My first test was to use one rsync for all website, but it uses 5GB. So I decided to split rsync but it still uses 5GB. In both of theses cases, it consume to much memory and are not always completely free after the process
If I manualy drop the cache between rsync, It only uses between 150Mb and 500Mb completely free the memory after the process. (And free 50%-70% memory of the server)
for CURDIR in "$ROOTDIR"* do echo "Start $CURDIR" rsync -aHh --stats --compress --delete "$CURDIR" --link-dest="saveofyesterday" "saveoftoday" echo "Clear" sync echo 3 > /proc/sys/vm/drop_caches echo "Finish $CURDIR." done
It's seems to be not recommend. What is the proper way to achieve this ?