Windows to Mac script conversion? Delete extra files.

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
kalel786
Newbie
Newbie
Posts: 5
Joined: August 8th, 2012, 6:22 am

Windows to Mac script conversion? Delete extra files.

Post by kalel786 »

Hey everyone!

I made the transition from Windows 7 to Mountain Lion.

This is my old post-processing script (cleanup.cmd) which worked fine with my Windows 7 setup. I renamed it to .py, tried to use it in MAC OS X, but it gives me an error, what changes do I have to make to convert it from a Windows 7 script to a Mac OS X script?
@echo off
setlocal
 
echo.
echo [Cleanup] Cleaning up download directory: %1
 
echo [Cleanup] Deleting .nzb files
DEL  %1\*.nzb  /S /F /Q
 
echo [Cleanup] Deleting .sfv files
DEL  %1\*.sfv  /S /F /Q

echo [Cleanup] Deleting .nfo files
DEL  %1\*.nfo  /S /F /Q

echo [Cleanup] Deleting .sub files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .srr files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .srs files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .idx files
DEL  %1\*.idx  /S /F /Q

echo [Cleanup] Deleting .sample files
DEL  %1\*sample*.avi  /S /F /Q

echo [Cleanup] Deleting .srr files
DEL  %1\*.srr /S /F /Q


echo.
This is the error it gives me
"Exit(1) SyntaxError: unexpected character after line continuation character (More)"

Thanks in advance!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Windows to Mac script conversion? Delete extra files.

Post by shypike »

A Windows cmd file is not a Python program, so this can never work.
You don't need a script anyway.
In Config->General you can list all extension that should be deleted.
In Config->Switches you can set "Ignore samples" to "Delete after download".
kalel786
Newbie
Newbie
Posts: 5
Joined: August 8th, 2012, 6:22 am

Re: Windows to Mac script conversion? Delete extra files.

Post by kalel786 »

shypike wrote:A Windows cmd file is not a Python program, so this can never work.
You don't need a script anyway.
In Config->General you can list all extension that should be deleted.
In Config->Switches you can set "Ignore samples" to "Delete after download".
Yeah I figured it wouldn't work. Thought I'd give it a try.

Anyways your method worked, THANKSSS XD.
Post Reply