Monitor shell script to go with crontab -e
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Ive been messing around with raspberry pis now for about a month and have come abit stuck.
I have set up a media server with 1 pi (6TB) and set up osmc with another (1TB). In the media server i have sonarr and radarr set up that will organise files into films and tv shows. I have mounted the server in osmc. What I need is a script to copy only new files from one directory to another. The files will be in subfolders. I was thinking crontab with a script linked to it to search every 15 mins to update osmc folders. 1 for tv shows 1 for movies.
Any help would be much appreciated
Thank you
shell-script raspberry-pi
add a comment |Â
up vote
0
down vote
favorite
Ive been messing around with raspberry pis now for about a month and have come abit stuck.
I have set up a media server with 1 pi (6TB) and set up osmc with another (1TB). In the media server i have sonarr and radarr set up that will organise files into films and tv shows. I have mounted the server in osmc. What I need is a script to copy only new files from one directory to another. The files will be in subfolders. I was thinking crontab with a script linked to it to search every 15 mins to update osmc folders. 1 for tv shows 1 for movies.
Any help would be much appreciated
Thank you
shell-script raspberry-pi
2
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
1
Have you looked intorsync
and read the man page? I don't think you need a script at all. I think you need a fancyrsync
command with a bunch of flags.
â Wildcard
Jan 5 at 3:04
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Ive been messing around with raspberry pis now for about a month and have come abit stuck.
I have set up a media server with 1 pi (6TB) and set up osmc with another (1TB). In the media server i have sonarr and radarr set up that will organise files into films and tv shows. I have mounted the server in osmc. What I need is a script to copy only new files from one directory to another. The files will be in subfolders. I was thinking crontab with a script linked to it to search every 15 mins to update osmc folders. 1 for tv shows 1 for movies.
Any help would be much appreciated
Thank you
shell-script raspberry-pi
Ive been messing around with raspberry pis now for about a month and have come abit stuck.
I have set up a media server with 1 pi (6TB) and set up osmc with another (1TB). In the media server i have sonarr and radarr set up that will organise files into films and tv shows. I have mounted the server in osmc. What I need is a script to copy only new files from one directory to another. The files will be in subfolders. I was thinking crontab with a script linked to it to search every 15 mins to update osmc folders. 1 for tv shows 1 for movies.
Any help would be much appreciated
Thank you
shell-script raspberry-pi
asked Jan 5 at 2:21
Azer.B
11
11
2
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
1
Have you looked intorsync
and read the man page? I don't think you need a script at all. I think you need a fancyrsync
command with a bunch of flags.
â Wildcard
Jan 5 at 3:04
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32
add a comment |Â
2
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
1
Have you looked intorsync
and read the man page? I don't think you need a script at all. I think you need a fancyrsync
command with a bunch of flags.
â Wildcard
Jan 5 at 3:04
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32
2
2
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
1
1
Have you looked into
rsync
and read the man page? I don't think you need a script at all. I think you need a fancy rsync
command with a bunch of flags.â Wildcard
Jan 5 at 3:04
Have you looked into
rsync
and read the man page? I don't think you need a script at all. I think you need a fancy rsync
command with a bunch of flags.â Wildcard
Jan 5 at 3:04
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Thanks for the help and pointing me to rsync. I made this script
#!/bin/sh
cd /directory/of/source/
find -type f -mmin -(time in mins) -exec rsync -zauv /directory/of/destination/ ;
Ran it on 2 test folders and all seemed to work. Just to link it to crontab and all done.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Thanks for the help and pointing me to rsync. I made this script
#!/bin/sh
cd /directory/of/source/
find -type f -mmin -(time in mins) -exec rsync -zauv /directory/of/destination/ ;
Ran it on 2 test folders and all seemed to work. Just to link it to crontab and all done.
add a comment |Â
up vote
0
down vote
Thanks for the help and pointing me to rsync. I made this script
#!/bin/sh
cd /directory/of/source/
find -type f -mmin -(time in mins) -exec rsync -zauv /directory/of/destination/ ;
Ran it on 2 test folders and all seemed to work. Just to link it to crontab and all done.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Thanks for the help and pointing me to rsync. I made this script
#!/bin/sh
cd /directory/of/source/
find -type f -mmin -(time in mins) -exec rsync -zauv /directory/of/destination/ ;
Ran it on 2 test folders and all seemed to work. Just to link it to crontab and all done.
Thanks for the help and pointing me to rsync. I made this script
#!/bin/sh
cd /directory/of/source/
find -type f -mmin -(time in mins) -exec rsync -zauv /directory/of/destination/ ;
Ran it on 2 test folders and all seemed to work. Just to link it to crontab and all done.
edited Jan 7 at 14:46
Jeff Schaller
31.8k848109
31.8k848109
answered Jan 5 at 15:08
Azer.B
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414901%2fmonitor-shell-script-to-go-with-crontab-e%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
So you need help with the crontab? the script? both? The crontab part is easy, but what the script has to do is far from clear (at least to me).
â NickD
Jan 5 at 2:47
1
Have you looked into
rsync
and read the man page? I don't think you need a script at all. I think you need a fancyrsync
command with a bunch of flags.â Wildcard
Jan 5 at 3:04
As mentionned by Wildcard, I think you need a rsync command line in a crontab to feet your needs. maybe something similar to rsync -zauv /path/sources/tree /path/destination/ then all subfolders updates modified & new files will be add/updated on destination path
â francois P
Jan 5 at 7:32