dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: bash-script: automatic upload of new files to archos/rockbox

bash-script: automatic upload of new files to archos/rockbox

From: Christian Folini <>
Date: Sat, 21 Sep 2002 11:35:57 +0200


i do a lot of radio streaming. Since i do not want to bother with
copying the files to my archos, i wrote the following script
which might be of use for someone. I run it once a minute
as a cronjob and simply attach my archos to the computer
once a day for a certain time.


P.S. I am looking forward to file-management in 2.0, as the ability
to remove/delete a radiostream-file i have listened to would be
more fun. Including that, rockbox is a great project.

#! /bin/bash
# Put daily updated files on the archos Player
# This file is not exactly proper, but you can easily
# adapt it to your needs.

export TRUE=-1
export FALSE=0
export LOCK=/tmp/archos-lock

function vprint {
        # print if verbose is set
        if [ $VERBOSE -eq $TRUE ]; then
                echo $1

function upload {
        wavp ~/data/beep.wav > /dev/null

        mount /mnt/archos
        vprint "archos mounted"

        cp -v /archive/mp3/rawstreams/*.mp3 /mnt/archos/actual
        vprint "all files copied."

        mv /archive/mp3/rawstreams/*.mp3 /archive/mp3/rawstreams/transferred
        vprint "all files on server moved to directory transferred."

        umount /mnt/archos
        vprint "archos unmounted"

        wavp ~/data/beep.wav > /dev/null

export FILES=`ls -1 /archive/mp3/rawstreams/*.mp3 2>/dev/null`
export ARCHOSMOUNT=`mount 2>&1 | grep "sda1"`
export ARCHOS=`/usr/sbin/lsusb -t 2>&1 | grep "Vendor 0x05ab Product 0x0060"`

        if [ ! "$FILES" ]; then
                vprint "No new files found. Aborting."
        if [ "$ARCHOSMOUNT" ]; then
                vprint "Archos already mounted. Aborting."
        if [ "$ARCHOS" ]; then
                vprint "Archos present."
                if [ -e $LOCK ]; then
                        vprint "Archos lockfile found. Aborting."
                touch $LOCK
                rm $LOCK
                vprint "Archos not present. Aborting."


for opt in $_at_;
        case $opt in
        "") echo "none.";;
        -d) export DEBUG=$TRUE;;
        -v) export VERBOSE=$TRUE;;
Received on 2002-09-21

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy