Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can someone look over my copy to external drive script please

Featured Replies

Hey guys,

i have a script to update an external harddrive with my media to give to my friends. I always thought it worked fine but i did a big update on friday night and i noticed it ignored one of the films added the day before that and there are some folders that are empty. (seems like the couchpotato ones that only have the extra files for xbmc etc but not the .mkv)

Here is my script if anyone wants to look at it.

thanks alot

#/bin/bash
echo "Update toshiba for the last how many days?"
read days

echo "Update Movies? [y/n]"
read ans
echo "Update TV? [y/n]"
read ansTwo
echo "Update Music? [y/n]"
read ansThree

if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
then
echo "Starting Movies..."
cd /mnt/user/Movies/
rsync -av --files-from=<(find -type f -mtime -$days) /mnt/user/Movies/ /mnt/disk/Toshiba/Movies/
fi

if [ $ansTwo = y -o $ansTwo = Y -o $ansTwo = yes -o $ansTwo = Yes -o $ansTwo = YES ]
then
echo "Starting TV..."
cd /mnt/user/TV/
rsync -av --files-from=<(find -type f -mtime -$days) /mnt/user/TV/ /mnt/disk/Toshiba/TV/
fi

if [ $ansThree = y -o $ansThree = Y -o $ansThree = yes -o $ansThree = Yes -o $ansThree = YES ]
then
echo "Starting Music..."
cd /mnt/user/Music/
rsync -av --files-from=<(find -type f -mtime -$days) /mnt/user/Music/ /mnt/disk/Toshiba/Music/
fi

echo " ______________________"
echo "|                      |"
echo "|      COMPLETE        |"
echo "|______________________|"

the files you downloaded often have a mtime, that's very old. it's the timestamp of when the file was created and zipped for distribution.

so if you download an old release (i.e. 400 days old) and start your script to copy the last 60 days, this file will not be copied.

 

mtime only changes, when the file content changes. it's not the day of your download.

it would be better to check for ctime (the time, the file was changed (any change counts, owner, permissions, etc). but i don't know, if rsync supports ctime.

  • Author

oh thanks alot benni-chan. I had a feeling it was something like that. I will change it to the date modified as every file gets renamed. thanks alot :]

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.