rsync backup only over night

it is kinda nice to have a rsync job running while the bandwidth is not needed otherwise.

  1. start a main script each night (using cron)
  2. the main script uses timeout to overlook the actual rsync 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

rsync script as in this post rsync backup script

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s