Dropbox/Robocopy - How to handle podcasts?

Soldato
Joined
4 Nov 2007
Posts
4,514
Going to be using my Kindle for podcasts, just wondering what's the best way to keep em nicely sync'ed to the kindle.

If I delete them from the Kindle when I'm done, Robocopy can delete the files from Dropbox & not add them to Kindle, right?

D:\audible (Kindle)

F:\Dropbox\Pocasts (files will be downloaded into here)
 
I can't work out what you're proposing, so I'm going to say how I've achieved much the same thing. It does rely on the computer you want to get files off having rsync available, either by being linux or through cygwin under windows.

I'm downloading newspapers via calibre which I wish to read on the kindle. Rather than copy them over usb, which I think you're suggesting, I'm using rsync over wifi. There's a hack readily available which enables network access over usb, and shortly afterwards over ssh. At any given point I've no idea what the IP of my kindle is, so I pull documents off a server with the --delete option. So, I reorganise files however I like on the server, deleting at will, and a little while later the kindle updates itself to match.

In case you're inclined to take that route, the following inelegant sh script, called every n minutes from cron, has worked well for me so far.
Code:
#! /bin/sh
# sync.sh
# Script to synchronise Kindle's documents folder with a file server. 
# Relies on jailbreak, usbnetworking, and on having set up passwordless ssh access to the server.
# rsync's --update: "skip files that are newer on the receiver", relies on both devices knowing the time.

# Directory structure on the server is as follows:
# $svrdir/documents $svrdir/newspapers $svrdir/other

# Change the following to match your setup. Note that there is no whitespace, nor trailing / on the directories
#server="jonj.dyndns.org"           # IP of server, mine changes so I'm using dynamic dns
svruser="root"                     # Username on the server
port="22"                       # ssh port listening on server
svrdir="/DataVolume/shares/Kindle" # Directory to pull data from on the server
idfile="/usr/local/bin/id_rsa"     # ID file used by dropbear when authenticating

# Defaults are probably alright here
locdir="/mnt/us"            # Directory on the kindle to sync to
updatetimefirst="true"                # Set to false to disable updating the time before sync
sshclient="/usr/bin/dbclient -i $idfile -p $port" # Include -y to disable host checking
ropt="-acqz"                # archieve, checksum, quiet, compress
lockfile="/mnt/us/sync.lock"

# Don't change this
direction="$1"
mkdir -p $locdir/documents
mkdir -p $locdir/documents/Newspapers

# Assuming the server normally allows ping; if you can't ping it, you probably can't ssh to it either. So turn off wifi to disable this script. 
if ping -c 1 $server > /dev/null
then

if [ ! -e $lockfile ]; then
   touch $lockfile

# Verify that known_hosts is still a non-empty file, create it if it isn't. Or use -y on sshclient
    if [ ! -s /var/tmp/root/.ssh/known_hosts ] ; then
mntroot rw
	echo "-key-goes-here-" > /var/tmp/root/.ssh/known_hosts
	chmod 644 /var/tmp/root/.ssh/known_hosts
   mntroot ro
 fi
    
    if [ "${updatetimefirst}" == "true" ] ; 
    then
	/usr/bin/ntpdate -s europe.pool.ntp.org &> /dev/null       
    fi

    if [ "${direction}" == "pull" ] ; then
# Pull documents from server to kindle
# --no-p stops rsync trying to set permissions on a vfat volume
	/usr/bin/rsync "$ropt" --no-p --update -e "$sshclient" $svruser@$server:$svrdir/documents/ $locdir/documents/  &> /dev/null

# Pull newspapers from server to kindle
	/usr/bin/rsync "$ropt" --no-p --delete -e "$sshclient" $svruser@$server:$svrdir/newspapers/ $locdir/documents/Newspapers/ &> /dev/null
    fi

    if [ "${direction}" == "push" ] ; then
# Push documents to server from kindle
	/usr/bin/rsync "$ropt" --update --exclude Newspapers -e "$sshclient" $locdir/documents/ $svruser@$server:$svrdir/documents/  &> /dev/null

# Backup everything that isn't documents to the server
	/usr/bin/rsync "$ropt" --update --exclude documents --exclude system/collections.json -e "$sshclient" $locdir/ $svruser@$server:$svrdir/other/  &> /dev/null
    fi
    
# /etc/init.d/framework restart
   rm $lockfile
fi
    
# Update the Kindle's document listing
sleep 10
    dbus-send --system /default com.lab126.powerd.resuming int32:1
    
fi

exit
 
Back
Top Bottom