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.

[SOLVED]I need help with a simple batch file or script

Featured Replies

I'm looking for a way to simply move movies from one user share into another. I have one user share for "Movies to Edit", and once I am done editing the details and grabbing fanart, I move them into a different user share for XBMC to access.

 

Up until now, I have been using telnet to move the files. I would love to have a batch file on my laptop or a script inside unRaid that would do this for me.

 

Unfortunately, I am a programming idiot, and would only serve to screw this up badly. So, if anyone is feeling philanthropic, your help would be sublimely appreciated.

 

Regards,

Matt

If you want to use a bat you should check out robocopy.

 

Ex:

Robocopy x:/edit y:/xbmc /move /s

 

Check http://ss64.com/nt/robocopy.html

 

If your running unmenu you can add your script in it so you just press a button.

I'm looking for a way to simply move movies from one user share into another. I have one user share for "Movies to Edit", and once I am done editing the details and grabbing fanart, I move them into a different user share for XBMC to access.

 

Up until now, I have been using telnet to move the files. I would love to have a batch file on my laptop or a script inside unRaid that would do this for me.

 

Unfortunately, I am a programming idiot, and would only serve to screw this up badly. So, if anyone is feeling philanthropic, your help would be sublimely appreciated.

 

Regards,

Matt

 

Example:

 

Create a file on your flashdrive that contains the following:

 

#!/bin/bash
mv -b /mnt/cache/.Transmission/incomming/* /mnt/user/Incomming
chown -R nobody /mnt/user/Incomming
chgrp -R users /mnt/user/Incomming
chmod -R 770 /mnt/user/Incomming

 

Then add the following to your GO file:

 

cp /boot/config/Empty_Flash /etc/cron.daily/Empty_Flash
chmod +x /etc/cron.daily/Empty_Flash

 

This will make sure that the files in /mnt/cache/.Transmission/incomming/ get moved to /mnt/user/Incomming on a daily basis.

 

Does that help ?

 

Should you want to run this hourly or weekly then use cron.hourly or cron.weekly instead.

 

  • Author

Thank you guys!!

Between Hellow's idea of making an unmenu user script and Helmonder's code, I put together exactly what I was after. You guys rock.

 

I created a user script unmenu_user_script_Move_Movies

inside of which I have

#define USER_SCRIPT_LABEL Move to Movies

#define USER_SCRIPT_DESCR This will move everything from the user share Movies to Edit to Movies

#define USER_SCRIPT_RELOAD 10

#!/bin/bash

chown -R nobody /mnt/user/Movies\ to\ Edit

chgrp -R users /mnt/user/Movies\ to\ Edit

chmod -R 770 /mnt/user/Movies\ to\ Edit

mv -b /mnt/user/Movies\ to\ Edit/* /mnt/user/Movies

 

You guys rock.

Matt

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.