Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, Everybody, I am for six years now on Mint, and very happy with the change! As I live high up in the Sierra in BCS, I have a Hughes Sattelite System (archaic), which is very "bandwidth-restrictive", but allows five hours of "free" use from midnight on. I hate getting up at midnight just to press the ENTER key on youtube-dl -a..., but don't know how to solve this problem. As I am 74 and have bad sight, please forgive if a similar question has been overlooked by me and just give me the link.
I would be extremely grateful to you if you could help me out of this "Midnight-Dilemna" and let me sleep again without interruption :-)
Best regards and thanks to all the unknown helpers in the many question &answers sections I have read to great avail these years !!!
Cheers
Thomas
assumming you have - at - installed. otherwise you need to install it. (via yum, zypper,etc depends on your linux flavor)
you should do this:
echo "youtube-dl http://your link" |at -m 0:05
or if you have multiple ones write them in a file and add it to crontab. if you need help ask and i will give you an example
Thanks, Random Troll, but that was very rudimentary and only really useful for "experts", of which I am none :-)
Dan.Mera - thank you so much - have made a trial ready for tonight with one youtube-video. Hope so much it will work !!!
Normally, I use youtubepdl like this:
youtube-dl -ci -f 18 -a z18 (z18 being a file collection)
Can I also use your example, modified like this:
echo "youtube-dl -ci -f 18 -a z18 |at -m 0:05
If YES, that would solve all my earthly problems (almost) :-)
If not, please be so kind and send me the crontab "version"
Thanks, Random Troll, but that was very rudimentary and only really useful for "experts", of which I am none :-)
I wrote it to begin a conversation. Ideally you would have run the man pages for both then, if you couldn't figure it out, ask again.
Quote:
Originally Posted by bajathomas
please be so kind and send me the crontab "version"
Run
Code:
crontab -e
Enter
Quote:
1 0 * * * youtube-dl -ci -f 18 -a z18
save (crontab -e will have started an editor) then quit. At 1 minute past midnight every day youtube-dl -ci -f 18 -a z18 will run. Every line in a crontab file has 6 arguments: minute, hour, day, month, day-of-week, file-to-run. If you want to run it only some days or months you can change the *s to specify by name or number days or months. Prepending a # will turn a line into a comment, if you want the line to not-run but don't want to remove if from your crontab file.
Thank you very much, Random Troll, now that did help -
will use your cron-"formula" tonight and hope for the best.
By the way, I did check the man-pages after your first post, but what is missing in these pages, IMHO, are a few typicall examples at the end - that would clarify the often very dry and technical (not to say obscure) text - no doubt excellently done, but not for Newbies or old geezers like me who read the screen with strong lenses and a lupa !
Anyway, thanks and will report the moment it works or ask some more dumb questions.
Cheers Thomas
a small typo in the command should be like this:
echo "youtube-dl -ci -f 18 -a z18" |at -m 0:05
this will need to be typed everytime after you updated your z18 file.
the cron will run daily so you will need to comment the line if you don't want to download something new like this:
crontab -e
and then insert a # before the 1 0 * * * youtube-dl -ci -f 18 -a z18
like this:
#1 0 * * * youtube-dl -ci -f 18 -a z18
until you have a new content in the z18 file and you want another download at midnight.
Last edited by dan.mera; 05-02-2019 at 11:00 AM.
Reason: few more details
Thank you, Dan, I appreciate your help - I now have a fairly good idea how this works and should be able to get the contraption going tonight.
By the way, I guess I can just leave the cron-order "running" and just switch off the Lap when I go to bed, on those days where there is nothing to download ?! That should work, or don't you think?
Can one use two cron-jobs at the same time? Like:
1 0 * * * youtube-dl -ci -f 18 -a z18
and
1 0 * * * youtube-dl -ci -f 249 -a z249
That would make a more efficient downloading possible -
video- and audio-files at the same time. Just wonder :-)
Tghanks agfain to both Dan and Troll for your time and effort; now I'll try a hell of a lot to get it going :-)
crontab jobs have a limited path. If youtube-dl isn't in the path it'll just report a not found error. To make sure I always supply a full path in crontab. For instance, youtube-dl is in /usr/local/bin on my system; /usr/local/bin isn't in the path crontab uses, so I'd write /usr/local/bin/youtube-dl
SHADOW 7, you nailed it !!!
Immediately got it going and working !!!
And I had started to download some articles and youtubevideos on cron to really "get it" and
be able to use it, but there are so many things
to learn like the path-"declarations" that Troll mentioned etc.pp. - for an old grand-grandfather a big deal.
I understand that "cron" and "at" are the tecnically
more "ambitious" and elegant solutions, but - hell,
this is a solution as simple as it is foolproof ! :-)
Thank you so much for your inspiration -you made my day!!!
How good one feels when a pressing problem is resolved!
My very best reagrds - also to Troll and Dan !
from Rancho Las Palmas en la Sierra de la Giganta, BCS
Hi bajathomas, to answer your questions:
the crontab is not executed if the laptop is down.
you can 2 or more lines to use different files, but if they run in parallel then they will slow each other, imagine a pipe through which 2 flows are going at the same time and you want to fill 2 or more buckets at the same time, it will work but patience. this being at night should be fine, hopefully able to complete by 4AM(free time).
good luck!
seen some nice pictures from Rancho Las Palmas en la Sierra de la Giganta
Thank you, Dan, although (with the sleep-method) I got lucky last night, and the littemath is no bother, I plan to "make myself more knowledegable" as far as LINUX commands are concerned, and especially cron and at.
So, your helpful hints will be well remembered soon...
In the meantime, I can sleep again quietly and that means a lot for me !
Yeah, this is a nice place, if you like the desert and "bare minimums", as I like to call it, but it has it charm and attraction - I love the quiet and peace, being far away from the madding crowd and having my own water and solar electricity plant, being at least a bit independent...
You probably saw the ad for the sale of the Rancho, eh??
For health reasons (my eyes are fading away = Macular deterioration, and arthritis and gout, nice combo!)
It;s tough, but has to be, I can't manage 150+ acres any more, and got to be nearer to town, Loreto or La Paz,on the outskirts, hopefully being able to find something at least a bit comparable in quiet and independence. Will see
Thanks again for your kind help and take good care of yourself and yours - thesde are trying times and there are dark clouds looming on the horizon...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.