Jump to content
We're Hiring! Full Stack Developer ×

Script schedule question


Recommended Posts

So I have a script (code below) that is supposed to delete nfo, sfv and srr files from my movies & tv_shows folders. I have scheduled the script with the following entry in the GO file

 

echo "/boot/delete_video_info_files" | at 3:00

 

and when I restart the server I get the message that the script will be executed the next morning at 3:00. However the script never runs automatically, or if it runs it doesn't delete any files.

It works flawlessly when manually run. What am I missing? Is the "spin-down" of the drives causing this (hence I put the sleep 10 in my script") or something else?

 

Thanks in advance for your help.

 

------script start------

 

#!/bin/sh

cd /mnt/user/movies

ls

sleep 10

touch edin.nfo

find . -name '*.nfo' -type f -print0 | xargs -0 rm

touch edin.sfv

find . -name '*.sfv' -type f -print0 | xargs -0 rm

touch edin.srr

find . -name '*.srr' -type f -print0 | xargs -0 rm

cd /mnt/user/tv_shows

ls

sleep 10

touch edin.nfo

find . -name '*.nfo' -type f -print0 | xargs -0 rm

touch edin.sfv

find . -name '*.sfv' -type f -print0 | xargs -0 rm

touch edin.srr

find . -name '*.srr' -type f -print0 | xargs -0 rm

 

-------script end---------

Link to comment

Archived

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

×
×
  • Create New...