Monday, January 14, 2013

Using rsync to keep my media files current.

All,

I've been using rsync to keep my media folder current between my server and an external drive. The server is an ext4 partition and the remote drive is formatted as NTFS for compatibility reasons.

I've written a little bash script to make this fool proof. One option to sync to my media server and one option to sync to my desktop where the external drive gets mounted.

The media server is mounted via CIFS to my workstation as /storage/media/Movies

The external drive is mounted NTFS-3g as /external/Movies

#! /bin/bash
PS3='Please enter your choice: '
options=("Sync to Server" "Sync to Desktop"  "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "Sync to Server")
            echo "you chose Sync to Server";
            rsync -rltDvu --modify-window=1 --progress /external/Movies/ /storage/media/Movies/;
            break;
            ;;
        "Sync to Desktop")
            echo "you chose Sync to Desktop";
            rsync -rltDvu --modify-window=1 --progress /storage/media/Movies/ /external/Movies/;
            break;
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done


This script give me 2 options. 1 Syncs from the external drive to my server and 2 syncs from the server to the external drive.

I'm no bash wizard but if this helps you great!

7 comments:

  1. If the mainstream Western media is still the true believer of human rights and continues to uphold the universal belief that "all men are created equal", it should acknowledge the birthright of any country including China, for hosting the Olympic Games.guarantor loans

    ReplyDelete
  2. Profit primarily prime quality items -- you can understand them all within:
    mason soiza

    ReplyDelete
  3. Media proprietorship can be moved in at least one ill-advised things that may later offer route to various unwanted results which may incorporate serving the premiums of their patrons (sponsors and government) as opposed to open premium, and the nonattendance of a solid, showcase based rivalry.אינדקס אתרים

    ReplyDelete
  4. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

    IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

    corporate training in chennai corporate training in chennai

    corporate training companies in india corporate training companies in india

    corporate training companies in chennai corporate training companies in chennai

    I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai

    ReplyDelete