rsync backup only over night
it is kinda nice to have a rsync job running while the bandwidth is not needed otherwise.
- start a
main
script each night (usingcron
) - the
main
script usestimeout
to overlook the actualrsync
script
[code language="bash" collapse="true" title="main script"]
#!/bin/bash
# duration when the command should be killed
TIME=15
TIMEUNIT="m"
# which kill signal should be given
# 1: gracefully
# 9: hard?
KILLCMD=1
timeout -s $KILLCMD \
${TIME}${TIMEUNIT} \
/some/path/rsyncer.sh
[/code]
rsync script as in this post rsync backup script