Synchronizing files using an input file

Who wants a challenge? :wink:

I have a Multimedia station (Damn Small Linux) that plays Video files using MPlayer.

I'm in desperate need of a Script that would be able to do the following:

The Multimedia station should read, at boot or through a cron job, a "Playlist" file on a remote machine. Download the files in the playlist from a remote location (a remote directory) and store them localy. At the next boot it should Sync. / Mirror the remote files with the local files. So if the playlist changes it should update the local content with new or newer files and delete the obselete ones. The playlist should be able to contain some URL's for streaming videos. In that case no mirror or sync is needed.

My scripting knowledge is limited, that is why I hope you can help me out.
(I'm from Holland so excuse my English)

Thanks al lot!

I have given it a try.

#! /bin/sh
rcp $USER@$HOST:/path/to/play.list $HOME/play.list

[[ -d /dir/with/updated/files ]] && rm -rf /dir/with/updated/files && mkdir -p /dir/with/updated/files

while read file
do
rcp  $USER@$HOST:$file /dir/with/updated/files/$file
done < $HOME/play.list

I havnt' done comparing the old playlist with the new one. That would generate a list containing exactly which files to retain and which to remove. (it is a much better solution). :slight_smile:

Vino