Thanks for this video, no annoying music, no bullsh!t, just straight to the point, and also you explain every single step you do including new keywords and everything. Thanks!!!
@JayMartMedia2 жыл бұрын
Thanks, glad you found it helpful!
@SkySesshomaru2 жыл бұрын
@@JayMartMedia Oh yeah we did, nice work there man.
@JayMartMedia5 жыл бұрын
Check out my 100 subscriber video to enter to win a SanDisk SSD: kzbin.info/www/bejne/paqalIyboJihpNk I'm not expecting a ton of entries, so your chance to win is decent. Entry is simple: • Comment on the giveaway video (include the name of a programming language) . • Subscribe to the channel. Full rules in the description of the giveaway video. Hope to see ya' there!
@JayMartMedia5 жыл бұрын
Google has changed this deal and now the free account is good for 3 months instead of 12 months as it was originally. Check out my video about uploading files to the Google Cloud server: kzbin.info/www/bejne/a6CsZo15Ys-hgLM
@kristians49584 жыл бұрын
JayMartMedia Hey,i have question when i put credit card info will it take out like 1€ like other sites do? so it could check if its real
@aman44344 жыл бұрын
Great video! I came to the comments to see if I could do this and you've said it yourself. I need to run a selenium script so do you think uploading the driver exe will work?
@JayMartMedia4 жыл бұрын
@@aman4434 Unfortunately Linux does not run .exe files natively. There is a chance that you could install a program, but I have never tried. You may be about to install a version of selenium that was built for Linux, it it MAY be possible to run a version of Windows on Google Cloud.
@aman44344 жыл бұрын
@@JayMartMedia ah right. I will check it out. This will still be useful for other purposes. Thanks again!
@patrickmuller98194 жыл бұрын
Thanks. These 10 minutes saved a lot of my time!
@JayMartMedia4 жыл бұрын
Great, glad to hear it!
@mr22b565 жыл бұрын
don't stop making videos. you way of explaining things is awesome
@GoodSmile33 жыл бұрын
This approach is not limited to python scripts, I deployed my jar as well, thank you!
@hanimyusof79735 жыл бұрын
Thanks alot! I was looking for this type of solution. Your tutorial is easy to follow. Thank you for sharing this. Keep up the good work.
@swahareddy88224 жыл бұрын
Loved it !! Thanks for taking it so slow and thorough :)
@JayMartMedia4 жыл бұрын
Glad you found it helpful!
@makedollarsandsense71944 жыл бұрын
This content quality and education value is great. Thank you so much!
@jbkwon3 жыл бұрын
Thank you so, so much. This was one of the best tutorials I have ever watched.
@user-qs7dp6yb2x2 жыл бұрын
BOMB!!!! Thank you for the video, especially for the cron!
@erensarnic40582 жыл бұрын
Most valuable 10 minutes I have ever seen 🙌
@alexandrutausch46164 жыл бұрын
great video. It was really helpful. I was able to automate a process of tunrning an XML into a csv and put it on a server for a php script to pick up and inject products into a e commerce shop data base. Thank you Jay!!
@greentea_4 жыл бұрын
This is extremely helpful. My code ran for about 25 hrs. Thank you!
@igorvujcic17314 жыл бұрын
I've been looking for this quite a lot, thanks for amazingly useful info
@zackplauche3 жыл бұрын
Bro your mic and radio voice is 🔥
@JayMartMedia3 жыл бұрын
Thanks!
@brexterity83853 жыл бұрын
This is the best and most useful tech video I've ever used. Thanks so much
@JayMartMedia3 жыл бұрын
I'm glad you found it helpful!
@MRichard3334 жыл бұрын
Hi, be careful, the blur can be removed, I don't want to teach how, but I suggest you and everyone to don't input private information under bluring. You can also simply make an exemple in text without your information for the video purposes. (My goal is to help, I hope it does) Nice video! Perfect for testing.
@venomlovekitties2 жыл бұрын
Blur can be removed? You think we live inside a cave?
@leonardosantana45432 жыл бұрын
nice bait
@srazavitousi4 жыл бұрын
Thanks for explaining what acronyms stand for, I never knew them!
@JayMartMedia4 жыл бұрын
Yes, understanding what the acronyms mean really helps me to remember them. Glad you found it helpful!
@OnlineGreg4 жыл бұрын
hey, nice video! but if i see it right, it is not for free. it is 4,28 USD monthly? (see 1:44 )
@MacTavishSoap14 жыл бұрын
Have the same question, although I have 2 guesses: 1. You have free tier for operations each month, and only exceeding are paid. 2. You have $300 credit for registration which is almost 6 years with that price.
@Origameasy3 жыл бұрын
*Actually you can directly upload your files by clicking the settings icon then "upload file", as simple as that no need to use FTP !*
@Joe-zg9eq3 жыл бұрын
Or you can use git to install your files from github. I prefer to use that way
@andywub4 жыл бұрын
clear and concise, thanks a lot my dude
@artabra10193 жыл бұрын
WOW this is the best tutorial in cloud easy to understand.
@IntrovertCoder4 жыл бұрын
Love your video! I'm working on a project with several APIs and I have to deploy it on a cloud but I don't have any experience with cloud
@masterburns3 жыл бұрын
thx, this is a really great tutorial and i could not have done the job without your help!
@JayMartMedia3 жыл бұрын
Glad you found it helpful!
@snerd69363 жыл бұрын
Sir you did this all wrong. You were straight to the point and showed exactly what to do. You explained everything. You didn't skip steps. Tisk tisk. Thank you so much!
@JayMartMedia3 жыл бұрын
Glad you found it helpful!
@yahiamahmoud3177 Жыл бұрын
Thanks a lot for this clear explanation, can you also explain how to run a scraping script on google cloud and how to get the outputs even if they were CSVs, images, pdfs, etc.?
@manchuparkaviks24034 жыл бұрын
Good one. EASY to follow and it works!
@cemdogansahin2 ай бұрын
Thank you. It really helped a lot. 👍🏻👍🏻👍🏻
@RUDAW129 ай бұрын
Love it!, much appreciated.
@RenatoEsquarcit4 жыл бұрын
Super well explained!
@wdhare3 жыл бұрын
This is fantastic! I am extremely new to Python and this is exactly what I wanted and very easy to follow. Thank you! One question - I just signed up for the Google Cloud Platform. If I selected the lowest VM tier items (like you did) to run my script, will this still be free for me to run after my trial runs out?
@JayMartMedia3 жыл бұрын
Glad you found the video helpful! No, unfortunately the trial does not extend after the 3 month trial, even if you have a credit remaining. So you will have to cancel after three months, or start paying.
@wdhare3 жыл бұрын
@@JayMartMedia Thanks for responding! I am running a very simple python script using TMUX. Is there a way to tell how much this will cost after the trial ends?
@JayMartMedia3 жыл бұрын
@@wdhare Unfortunately I can't say for sure exactly how much it would cost. Google has a calculator here which says that one instance of the f1-micro compute engine will cost ~$3.88/month when running 24/7: cloud.google.com/products/calculator One option would be to continue one month after the trial ends, and then cancel if. You decide it is too expensive.
@wdhare3 жыл бұрын
@@JayMartMedia Thanks! Huge help!
@jakubkahoun52632 жыл бұрын
@@JayMartMedia Actually this answer is false, since T2 micro in free tier, so if you have ONE T2 micro instance, you can have it for unlimited time for free. (You have 720h montly)
@nasr-rsln5 ай бұрын
man.. you're amazing!!!!!!
@JainmiahSk4 жыл бұрын
Like Heroku, If I want to run the script continuously 24/7 as there are some scheduled functions in it. Which will be the cheaper option GCP or Heroku
@prayushdawda78075 жыл бұрын
So, by using tmux, is the script in running state or does tmux only save the last state and then resumes to that state once we manually login? So, for example, if I had a script that continuosly downloaded random images from the internet and I leave it on with tmux, would it continue downloading images in the background even when I've closed the SSH terminal? Btw, awesome tutorial!
@JayMartMedia5 жыл бұрын
Good question, tmux stays in a running state even after you disconnect. Assuming that your script doesn't crash, and that you wrote your script to run continually (for example, a while longer that never exits) it will continue downloading images from the internet!
@qwertwhy36012 жыл бұрын
Very well explained, saved so much of my time! I have a question though, basically if my script was supposed to run forever, I'd be using tmux right?
@JayMartMedia2 жыл бұрын
Correct, tmux will allow the script to continue running when you close the terminal window. If there is an uncaught error in your program it will stop. You could look into using something like PM2 to restart your script if it ever stops: www.npmjs.com/package/pm2
@qwertwhy36012 жыл бұрын
@@JayMartMedia Alright, thanks
@sig78132 жыл бұрын
Another great video. Thank you
@haseebkhang13 жыл бұрын
dear sir i am quite new to this field and watched this very carefully and i was so impressed, but now tell me about my password my project id and how to deploy python code regards abdul haseeb
@EnglishRain3 жыл бұрын
Thanks for the "update" heads up in the description!
@codewik11764 жыл бұрын
Thank you so much. .This is the video I am searching for.
@felixtorres43012 жыл бұрын
Amazing tutorial. Thank you so much bro!
@johnl90152 жыл бұрын
Hi I'm getting an error that says: Reading state information... Done E: Unable to locate package python3.9 E: Couldn't find any package by glob 'python3.9' E: Couldn't find any package by regex 'python3.9' when trying to execute sudo apt-get install python3.9 Any thoughts?
@JayMartMedia2 жыл бұрын
You will need to add an additional package archive to install newer versions of python. Here is an article about that: docs.python-guide.org/starting/install3/linux/
@muhammedozdemir59333 жыл бұрын
YOU ARE GREAT MAN !
@JayMartMedia3 жыл бұрын
Thanks, glad you found the video helpful!
@zelbeboshoff25333 жыл бұрын
How do we install all the dependencies needed for our python script?
@JayMartMedia3 жыл бұрын
You can use pip to install packages just as you would locally. Here is a video where I install the discord library, your libraries will be similar, just a different package name: kzbin.info/www/bejne/jHbRaGN5bLhoh5o
@zelbeboshoff25333 жыл бұрын
@@JayMartMedia thanks for all the help!
@digitalnomad21967 ай бұрын
Great Share ! I know it says the about hourly 0.006 hourly so if you a run a simple script all day rob wont charge you. The estimate monthly says 4.28 dollars. Im assuming you tried this and never got charged.
@JayMartMedia7 ай бұрын
Yeah, this tutorial is pretty old, but there is still a 90 day trial where you can use up to $300 of credit (if it's a new account). It also looks like you can have one free small compute VM indefinitely as long as it is in one of the eligible regions: cloud.google.com/free/docs/free-cloud-features#free-tier-usage-limits
@digitalnomad21967 ай бұрын
@@JayMartMedia awesome thanks, do you have any new videos on this on your channel.
@abetterliferu3 жыл бұрын
Super cool tutorial i dreamed of!!! Thank you a ton👍👍👍👍👌👌😎
@JayMartMedia3 жыл бұрын
Glad it helped you, Bogdan!
@EL-sc9on Жыл бұрын
can you make an update video to this showing how to restart and run the script even after it crashes
@GhullieUser4 жыл бұрын
This is great! Thanks man
@ShovonMallick413 жыл бұрын
mkdir: cannot create directory ‘first-directory’: Permission denied if there any supporting file need to run that script, where should i put it? I have a python script that uses selenium webdriver to scrap data and then push this data to google sheet, how can I deploy this code including all supporting file on google cloud?
@JayMartMedia3 жыл бұрын
Should not be anything else that you need to run before creating a new directory. Where are you trying to create the directory? It may be restricted and require admin permission to create a new directory in that directory. You should either run 'sudo mkdir {insert name of dir}' to try to create the directory as a super-user (admin). Or you could try to cd into a different directory that is not restricted. 'cd ~' will move you to the home directory of the current user, which I expect will not be restricted.
@joaopedro-jo8zg3 күн бұрын
Thank you, i found a lot of videos recomending some shity free services. while google doing this amazing job. apreciate it my friend 🇧🇷
@KJ-fs1li3 жыл бұрын
Is it necessary to use tmux with corntab to run even if you close
@ashishmagar5814 жыл бұрын
Hey, working on college project n I've one python code and want to keep it running continuously 24/7, as it contains conditional statements, I don't want to start the whole code again from beginning, just want to keep it active/running as it is for 24/7 until it gets stopped by stop() command. I don't know whether it's possible as you described in video at last using tmux, as it restarts the code from start.
@BaceJeleren4 жыл бұрын
You would have to implement your own loop in your code, and just run it using tmux once. This could create some problems depending on your code though, and you'd need a lot of error handling
@scotter4 жыл бұрын
Thank you! Possible to use this method (Google Cloud) to run a python-based web site associated with a domain name?
@JayMartMedia4 жыл бұрын
Yes, that is possible! The most difficult part is setting up the nameservers and port forwarding. This documentation may help you out: codelabs.developers.google.com/codelabs/cloud-webapp-hosting-gce/index.html?index=..%2F..index#0
@KM-yw3ft3 жыл бұрын
Hey, I am a bit confused and new to this stuff. Do you have to use tmux to keep the crontab running or they are two separate things and once I set up a crontab it will be live and stay live even if I close the window?
@JayMartMedia3 жыл бұрын
You do not have to use tmux to keep cron running. Cron will continue running commands at the specified time once the crontab is saved and closed.
@danieltech94585 жыл бұрын
Thank you, I got it make my project. Your video is amazing
@tommyc_1232 жыл бұрын
Awesome video! Thanks a lot.
@JayMartMedia2 жыл бұрын
Thanks! Glad you found it helpful!
@jal051 Жыл бұрын
One question. What is the difference between Compute Engine, App Engine and Cloud Run?
@JayMartMedia Жыл бұрын
Compute engine is a virtual machine running on a cloud server. You don't maintain the hardware, but you have full control of the OS. Cloud Run is used to run docker images. So you create a docker (or other container) image, and tell cloud run what image to use, and it will spin up and scale as needed. App Engine is somewhat between the two. It is similar to Cloud Run, except you don't need to create a docker image. App Engine supports a few popular language, but not all languages. Here is a document from Google that may be helpful: www.google.com/url?sa=t&source=web&rct=j&url=cloud.google.com/blog/topics/developers-practitioners/where-should-i-run-my-stuff-choosing-google-cloud-compute-option
@jal051 Жыл бұрын
@@JayMartMedia Thank you!
@lucasfernandeslima74744 жыл бұрын
very nice, Jay! thank you!
@Zipppy0124 жыл бұрын
One Question I have created a python game using pygame and tkinter and i want to upload the file on the web/make the game run on the web and have its own address not localhost how can i do that?
@RabeeQasem3 жыл бұрын
thank you man :-) but I have a question when we say ( 4 v CPU) for example we mean by that 4 core CPU ?
@JayMartMedia3 жыл бұрын
Pretty much. vcpu is a virtual cpu, this could be a single core or in the case of hyper-threading, there may be two vcpu's per core. stackoverflow.com/questions/45967797/is-1-vcpu-on-google-compute-engine-basically-half-of-1-physical-cpu-core
@imVoyager32 жыл бұрын
Any good tips on how to integrate this with some sort of web form that other people can use? For instance if I wanted to perform some simple script hosted as you describe above, but have a web form where people can enter the parameters to run it with and see the results?
@giovanninirta9453 жыл бұрын
Thanks for the video, it's been very helpful. One question, why my bot python go on sleep mode and it Needs two commands for start?
@goaapie4 жыл бұрын
@JayMartMedia Do I need to run the TMUX command in order to have the CRON JOB work? Or is this something seperate?
@JayMartMedia4 жыл бұрын
These are separate things. The cron job simply runs a specified command at a specific time (Command Run ON). And tmux allows a terminal session to remain open after disconnecting.
@marekkancir82724 жыл бұрын
Hey, can I download txt or csv file which has been created by a script? Is it accessable from google drive or is there some easy chain of commands to either dowload it directly or move it to the my google drive? Thanks a lot!
@08ykr224 жыл бұрын
I have a question. If I need another file besides the python code in the directory, for example a JSON file, how would I add that to the directory? Would I add it the same way the python file was added?
@JayMartMedia4 жыл бұрын
You can either create it as you did the python file, or you can follow this video about uploading files: kzbin.info/www/bejne/a6CsZo15Ys-hgLM Or you can look up how to upload files via FTP
@08ykr224 жыл бұрын
@@JayMartMedia Thanks!
@parthpatel55324 жыл бұрын
i have a question, i have a python script that does checks prices for products on amazon, and emails me if if there is a price drop/discount. So because of that, my python script requires other libraries, so will I need to first pip install/download those libraries to the server?
@JayMartMedia4 жыл бұрын
You will need to use pip to install those libraries onto the virtual machine
@Harry-tj2yz5 жыл бұрын
May be a stupid question but when u install something with pip can you just type import in the python document or will u need to gave it a file directory or move stuff around?
@JayMartMedia5 жыл бұрын
When you install with pip you should be able to just import in your python script. No moving files around required!
@kalpeshrawal76613 жыл бұрын
What's difference between screen and tmux ? Which is better and for what reasons ?
@JayMartMedia3 жыл бұрын
It's really personal preference. They both have a lot of the same features, and either could be used to run the script in the background. linuxhint.com/tmux_vs_screen/
@kalpeshrawal76613 жыл бұрын
@@JayMartMedia Thanks 👍
@kalpeshrawal76613 жыл бұрын
@@JayMartMediacan you plz make a video on how to read msg. From multiple group or channels of telegram in which we are not admin but just member. I done that but that's only applicable for a single group or channel not able for multiple
@danzrust4 жыл бұрын
Any ideas why SSH window keeps crashing a few moments after I click the "SSH" button? I can't get into the black SSH at all... I just see the loading screen and then boom... crash. I just see "Transferring SSH keys to the VM".... I am clicking the SSH button for the very first time, had never logged in before because I keeps failing ever since.
@JayMartMedia4 жыл бұрын
I'm not sure. I haven't had that problem before. I tried to see if I could find a solution online, but nothing stick out to me. If there is a specific error message displayed, I would try copy/pasting that into your search bar in case someone else has had the problem. Otherwise you may be able to try a different browser
@danzrust4 жыл бұрын
@@JayMartMedia I've found a person on stackoverflow with the same issue but no suggestion provided... I tried different browser, different projects... same issue, I don't really understand.
@JayMartMedia4 жыл бұрын
The only other option I can think of is using a different ssh client. You may be able to use gcloud: Click the dropdown next to the SSH button in the google cloud console and click "View gcloud command", then click "Run in cloud shell". This should open a panel in the bottom of your browser and prompt you to create an RSA key (type "Y" for yes, type a new password for the key, confirm the password) Alternatively you could use a third-party client such as PuTTY on Windows. This will be more difficult to set up if you haven't done it before. You can probably find another youtube video about it, and there is also documentation from Google here: cloud.google.com/compute/docs/instances/connecting-advanced#thirdpartytools
@brianwalsh70404 жыл бұрын
Great, thank you! do i get charged for running the vm for all the time my script is not running? For example, I run my script nightly at 8pm -- am i getting billed for running the vm for the other 23:50 hours of the day I am not running the script? Also how can I tell if my script is running from the cron job?
@thecorruptraider51124 жыл бұрын
With google, you have the $300 free credit, and, they don't charge you unless you manually sign up to do so.
@as342424 жыл бұрын
Beast, appreciate it man!
@jayjaychoo72844 жыл бұрын
Hi Jay, thanks for the informative video. I am currently making a Twitter bot which is supposed to run on an hourly basis. I followed the crontabs part, but it doesn't seem to run, any idea what's causing this? Must I use tmux for this since I only want the bot to post hourly? Thanks once again.
@Justin-General4 жыл бұрын
I am having difficulties understanding the frequency, say I wanted to run nightly, doesn't matter when, so say midnight, what is the cronjob setting then? Thanks!!
@JayMartMedia4 жыл бұрын
This site may be helpful when setting cron job frequencies: crontab.guru/every-night-at-midnight Tl;dr: "0 0 * * *" is midnight First: 0 means it only runs the first minute Second: 0 means it only runs in the first hour Third: * means it runs any day of the month Fourth: * means it runs any month Fifth: * means it runs any day of the week
@muhammadyousef6261 Жыл бұрын
Thank you so much for this video, I tried the cronjob however it's not working.
@liamtrotzuk594 жыл бұрын
fantastic tutorial. thank you so much for sharing - incredibly helpful.
@iriealdana92283 жыл бұрын
question how to import package to the python script? it always says "ModuleNotFoundError: No module named 'schedule'
@lugiadark214 жыл бұрын
You are a GOD. One video is all I needed, that is a miracle. Thank you so much
@SlightCatch4 жыл бұрын
help! everything works but the crontab! i write "00 10 * * * python tweepy-bots/mybot.py" but it doesnt work! it works when i write it (its a twitter bot, when i type the command it works) but if i put that in crontab it doesnt work at all and i really dont know what to do.
@JayMartMedia4 жыл бұрын
The issue is likely that you are using a relative file path in the command. A relative path is dependent on which directory that you are in when you run a command. Crontab is likely 'running' the command from a different directory than you are running it from when you are testing the command. I would recommend using an absolute path. Here is a document which discusses the difference between relative vs absolute file paths: www.google.com/amp/s/www.geeksforgeeks.org/absolute-relative-pathnames-unix/amp/ Hope that helps!
@viniciusmacario46602 жыл бұрын
Great video!
@jeffbong79894 жыл бұрын
Hi Jay, this video is amazing, exactly what I am looking for! Thanks Jay!. However, I do have some confusion here. 1. Is the CRONTAB-E function same as TMUX? Is there any relation between tmux and cron job? 2. If I want to schedule a cron job to send out an email at 7pm every day, do I need to do the tmux thing first? Or just open ssh and then type crontab -e? 3. If i don't use the tmux upfront and set up a cron job, will the script running after I close the cron job? Your advise is very much appreciated.. Millions thanks in advance!
@JayMartMedia4 жыл бұрын
Hi Jeff, I'm glad you found the video helpful! There is no relation between tmux and crontab. Crontab is used for running commands at a certain time or interval. Cron comes from "Command Run ON". It literally just runs a certain command at a certain time. In this video I'm only using tmux to keep the terminal session active after closing the browser terminal. From what you said, it sounds like you probably just want to use crontab. The Cron job will run at the specified time even if you do not have a current terminal session (so you don't need tmux).
@jeffbong79894 жыл бұрын
@@JayMartMedia Hi Jay, you are such a good guy! Thank you very much for your reply and detail reply. I have tried and it works, and at the same time has understand crontab and tmux better now.. A big thank you for your help! I will always view your video!
@kelvao.mp43 жыл бұрын
can I host a bot to run 24 hours? or would I have a limit and would I have to pay something?
@JayMartMedia3 жыл бұрын
Yes, you could run the bot 24/7 for three months until the trial period runs out. Then you would have to start paying. I believe there is also a spending limit during the trial period as well, but you shouldn't get anywhere close to it if you get a single, small compute instance.
@varshilshah83115 жыл бұрын
post 12 months / after my free credits i still have to pay right ?
@avishkarraut47554 жыл бұрын
Does scripts works even after we shut down system ?? Also I don't understand why you have filled info in google cloud platform ??
@edwinite4 жыл бұрын
I'm getting this error and when I delete this code line it's still happening in other lines can you help me with that please ? File "bot.py", line 64 await channel.send(f'Welcome {member.mention}! Ready to jam out? See `!help` command for details!') ^ SyntaxError: invalid syntax
@sebastianmedina49933 жыл бұрын
Hi this work for a webpage created with django?
@JayMartMedia3 жыл бұрын
Yes, this would work with a django web server. Just need to make sure that you open the http and/or https port on the compute engine instance
@sebastianmedina49933 жыл бұрын
@@JayMartMedia thanks!! (Sorry for my bad English, im from Argentina 🤣)
@JayMartMedia3 жыл бұрын
Your English is much better than my Spanish!
@KobiLDN Жыл бұрын
very usefull, thanks for making this
@adalar422 жыл бұрын
Great video, thanks
@lkogangster91623 жыл бұрын
YAY THANKS btw this is da 200th comment pls pin
@JayMartMedia3 жыл бұрын
Hey Gangster, glad you found the video helpful! Thanks for 200th comment!
@SmarcosGameR3 жыл бұрын
Hi, my script needs several packages , where i have to install it ?
@syedaizaznaqviofficial54532 жыл бұрын
How to create virtual environment or install requirements on cloud machine while running the script
@JayMartMedia2 жыл бұрын
You can use docker to containerize an application in the computer engine instance, you can use pip or pip3 to install python libraries, you can use apt/apt-get to install other programs or applications
@saurabhclh2 жыл бұрын
Amazing video, How can i run selenium script in google cloud.
@djariwala19903 жыл бұрын
Helloo.. I am new on python and i want to install python web application on my web hosting ...and I face problem for installing pip install TA-Lib using Cpanel terminal..please help if you know solution
@TheNoviceCreator4 жыл бұрын
Will I be able to see the prints of my python script while it is executed using a crontab?
@JayMartMedia4 жыл бұрын
Copied from another comment thread: Outputting to a console from cron is difficult. However, if you only want to view the output, then you can save the scripts output into a text file pretty easily. Try using : "*/5 * * * * /usr/bin/python3 /home/USERNAME/my-first-directory/my-script.py > /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" All I did was append "> /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" to the end of you current Cron job. The ">" routes the normal output to the file specified. The "2&>1" routes any error output to the same file (alternatively you could replace the "1" in "2&>1" with a path to a different file if you wanted error output to a different file.) Let me know if this helps you out!
@TheNoviceCreator4 жыл бұрын
@@JayMartMedia thank you I'll try; my system is a bit complex in terms of prints because it scrapes form e-commerce sites, and I need to know if there is any unhandled exception.
@gnm2803 жыл бұрын
This might be dumb question but it will work for ruby scripts in the crontab? like "ruby my-script.rb
@JayMartMedia3 жыл бұрын
Yes, it will work for other languages/programs too. (Assuming the languages runtime environment etc. is installed!)
@gnm2803 жыл бұрын
@@JayMartMedia thanks...I have succesfully implemented this solutions of yours for my project using python scripts..But now in other project, I'm trying to run ruby scripts and nothings happens. Its there a way to debugg it ? The commands in crontab -e wont run.
@JayMartMedia3 жыл бұрын
Here's a copy pasted response to debugging cron tab. I think it may be helpful in this case: Outputting to a console from cron is difficult. However, if you only want to view the output, then you can save the scripts output into a text file pretty easily. Try using : "*/5 * * * * /usr/bin/python3 /home/USERNAME/my-first-directory/my-script.py > /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" All I did was append "> /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" to the end of you current Cron job. The ">" routes the normal output to the file specified. The "2&>1" routes any error output to the same file (alternatively you could replace the "1" in "2&>1" with a path to a different file if you wanted error output to a different file.) Let me know if this helps you out!
@JayMartMedia3 жыл бұрын
I would make sure that you are using an absolute file path as opposed to a relative path. It could be that cron is attempting to run the script, but can't find it due to a relative path.
@gnm2803 жыл бұрын
@@JayMartMedia thanks...I'm trying all sort of things. I have a script to insert rows into my bigquery table. If I run "ruby ~/scripts/insert_rows.rb" in my home directory, It works perfectly. If I wrote this same command in my crontab file nothing happens. Edit: I tried the command "touch test.txt" and works perfectly
@timtom34034 жыл бұрын
Bro do python selenium scripts run on free VMs?I tried AWS free windows VM , didn't work on it
@JayMartMedia4 жыл бұрын
The Google Cloud VM's in this video are connected to the internet, so I believe it should work.
@timtom34034 жыл бұрын
@@JayMartMedia even the aws vms are connected to the internet
@СуперХмырь5 жыл бұрын
Awesome, thanks man! But I used it on Russian Yandex Cloud :D
@JayMartMedia5 жыл бұрын
Great. I'm glad it worked for you!
@eazye70593 жыл бұрын
яндекс дерьмо феерическое.Самая еб*нутая авторизация на яндекс клауд ,из всех что я видел. так и не удалось зайти)
@Cyrus_FG4 жыл бұрын
Can you not install pip files, it won’t let me, keeps saying pip command not found
@hhhqqq39184 жыл бұрын
idk how to use this, but i wna just learn to make a gui rock paper scissors game on this. awesome! going to start this project!
@P3teR0cK5 жыл бұрын
good job. very helpful
@JayMartMedia5 жыл бұрын
Thanks for the encouragement. I'm glad you found the video helpful.
@aiblessed90615 жыл бұрын
the ls doesn't work... please tell me why?
@JayMartMedia5 жыл бұрын
Hmmmm, I'm not sure why that doesn't work. Are you sure you are using a Linux based operating system? On Windows, the command to list the contents of a folder is "dir".
@JayMartMedia5 жыл бұрын
Also, are you sure that there are files in the directory that you are using ls in? Try doing: "cd .." (this will move you to the parent directory) Then: "ls" (this should list the directory that you were just in)