Free Hosting for Python Scripts on Google Cloud

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Update: Google has changed this deal and now the free usage is only for 3 months rather than the original 12 months.
    In this video I show you how to create a free Google Cloud account and host your Python scripts in the cloud.
    I also show you how to use a tmux so your script will continue to run when you close the SSH window.
    Finally I show how to use crontabs to schedule you script to run automatically.
    If you have any questions, please leave them below and I'd be glad to help you out!

Комментарии • 252

  • @exp8786
    @exp8786 Год назад +14

    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!!!

    • @JayMartMedia
      @JayMartMedia  Год назад +3

      Thanks, glad you found it helpful!

    • @SkySesshomaru
      @SkySesshomaru Год назад +1

      @@JayMartMedia Oh yeah we did, nice work there man.

  • @patrickmuller9819
    @patrickmuller9819 4 года назад +13

    Thanks. These 10 minutes saved a lot of my time!

  • @MRichard333
    @MRichard333 3 года назад +6

    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.

  • @GoodSmile3
    @GoodSmile3 3 года назад +1

    This approach is not limited to python scripts, I deployed my jar as well, thank you!

  • @hanimyusof7973
    @hanimyusof7973 5 лет назад +12

    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.

  • @mr22b56
    @mr22b56 5 лет назад +3

    don't stop making videos. you way of explaining things is awesome

  • @swahareddy8822
    @swahareddy8822 4 года назад +9

    Loved it !! Thanks for taking it so slow and thorough :)

  • @makedollarsandsense7194
    @makedollarsandsense7194 4 года назад +7

    This content quality and education value is great. Thank you so much!

  • @alexandrutausch4616
    @alexandrutausch4616 4 года назад +5

    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!!

  • @snerd6936
    @snerd6936 2 года назад +2

    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!

  • @erensarnic4058
    @erensarnic4058 2 года назад +2

    Most valuable 10 minutes I have ever seen 🙌

  • @jbkwon
    @jbkwon 2 года назад +2

    Thank you so, so much. This was one of the best tutorials I have ever watched.

  • @greentea_
    @greentea_ 4 года назад +1

    This is extremely helpful. My code ran for about 25 hrs. Thank you!

  • @igorvujcic1731
    @igorvujcic1731 3 года назад +2

    I've been looking for this quite a lot, thanks for amazingly useful info

  • @user-qs7dp6yb2x
    @user-qs7dp6yb2x 2 года назад +1

    BOMB!!!! Thank you for the video, especially for the cron!

  • @zackplauche
    @zackplauche 2 года назад +1

    Bro your mic and radio voice is 🔥

  • @Origameasy
    @Origameasy 3 года назад +2

    *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-zg9eq
      @Joe-zg9eq 3 года назад +2

      Or you can use git to install your files from github. I prefer to use that way

  • @srazavitousi
    @srazavitousi 3 года назад +1

    Thanks for explaining what acronyms stand for, I never knew them!

    • @JayMartMedia
      @JayMartMedia  3 года назад +1

      Yes, understanding what the acronyms mean really helps me to remember them. Glad you found it helpful!

  • @IntrovertCoder
    @IntrovertCoder 3 года назад +3

    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

  • @brexterity8385
    @brexterity8385 3 года назад +1

    This is the best and most useful tech video I've ever used. Thanks so much

  • @lugiadark21
    @lugiadark21 4 года назад +5

    You are a GOD. One video is all I needed, that is a miracle. Thank you so much

  • @artabra1019
    @artabra1019 2 года назад +1

    WOW this is the best tutorial in cloud easy to understand.

  • @walbarn
    @walbarn 3 года назад +5

    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?

    • @JayMartMedia
      @JayMartMedia  3 года назад +3

      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.

    • @walbarn
      @walbarn 3 года назад +1

      @@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?

    • @JayMartMedia
      @JayMartMedia  3 года назад +1

      @@walbarn 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.

    • @walbarn
      @walbarn 3 года назад

      @@JayMartMedia Thanks! Huge help!

    • @jakubkahoun5263
      @jakubkahoun5263 Год назад +1

      @@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)

  • @masterburns
    @masterburns 3 года назад +1

    thx, this is a really great tutorial and i could not have done the job without your help!

  • @andywub
    @andywub 4 года назад +2

    clear and concise, thanks a lot my dude

  • @OnlineGreg
    @OnlineGreg 4 года назад +8

    hey, nice video! but if i see it right, it is not for free. it is 4,28 USD monthly? (see 1:44 )

    • @MacTavishSoap1
      @MacTavishSoap1 4 года назад

      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.

  • @KJ-fs1li
    @KJ-fs1li 3 года назад +1

    Is it necessary to use tmux with corntab to run even if you close

  • @rudawabdulrahman1010
    @rudawabdulrahman1010 5 месяцев назад +1

    Love it!, much appreciated.

  • @nasr-rsln
    @nasr-rsln Месяц назад +1

    man.. you're amazing!!!!!!

  • @prayushdawda7807
    @prayushdawda7807 4 года назад +3

    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!

    • @JayMartMedia
      @JayMartMedia  4 года назад +3

      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!

  • @manchuparkaviks2403
    @manchuparkaviks2403 3 года назад +1

    Good one. EASY to follow and it works!

  • @codewik1176
    @codewik1176 4 года назад +1

    Thank you so much. .This is the video I am searching for.

  • @danieltech9458
    @danieltech9458 5 лет назад +1

    Thank you, I got it make my project. Your video is amazing

  • @zelbeboshoff2533
    @zelbeboshoff2533 2 года назад +2

    How do we install all the dependencies needed for our python script?

    • @JayMartMedia
      @JayMartMedia  2 года назад +1

      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: ruclips.net/video/VEn70C7S5Q8/видео.html

    • @zelbeboshoff2533
      @zelbeboshoff2533 2 года назад +1

      @@JayMartMedia thanks for all the help!

  • @lkogangster9162
    @lkogangster9162 3 года назад +1

    YAY THANKS btw this is da 200th comment pls pin

    • @JayMartMedia
      @JayMartMedia  3 года назад

      Hey Gangster, glad you found the video helpful! Thanks for 200th comment!

  • @JayMartMedia
    @JayMartMedia  5 лет назад +6

    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: ruclips.net/video/5oI5ZC-jnJQ/видео.html

    • @kristians4958
      @kristians4958 4 года назад

      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

    • @aman4434
      @aman4434 4 года назад +1

      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?

    • @JayMartMedia
      @JayMartMedia  4 года назад

      @@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.

    • @aman4434
      @aman4434 4 года назад +1

      @@JayMartMedia ah right. I will check it out. This will still be useful for other purposes. Thanks again!

  • @JainmiahSk
    @JainmiahSk 3 года назад +1

    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

  • @EnglishRain
    @EnglishRain 3 года назад

    Thanks for the "update" heads up in the description!

  • @yahiamahmoud3177
    @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.?

  • @qwertwhy3601
    @qwertwhy3601 2 года назад

    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?

    • @JayMartMedia
      @JayMartMedia  2 года назад

      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

    • @qwertwhy3601
      @qwertwhy3601 2 года назад +1

      @@JayMartMedia Alright, thanks

  • @felixtorres4301
    @felixtorres4301 2 года назад +1

    Amazing tutorial. Thank you so much bro!

  • @abetterliferu
    @abetterliferu 3 года назад +1

    Super cool tutorial i dreamed of!!! Thank you a ton👍👍👍👍👌👌😎

  • @RenatoEsquarcit
    @RenatoEsquarcit 3 года назад +1

    Super well explained!

  • @haseebkhang1
    @haseebkhang1 3 года назад

    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

  • @sig7813
    @sig7813 Год назад +1

    Another great video. Thank you

  • @ShovonMallick41
    @ShovonMallick41 3 года назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  3 года назад +1

      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.

  • @Zipppy012
    @Zipppy012 4 года назад +1

    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?

  • @johnl9015
    @johnl9015 Год назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  Год назад

      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/

  • @user-he6fl6vr4b
    @user-he6fl6vr4b 4 года назад +6

    Awesome, thanks man! But I used it on Russian Yandex Cloud :D

    • @JayMartMedia
      @JayMartMedia  4 года назад +2

      Great. I'm glad it worked for you!

    • @eazye7059
      @eazye7059 3 года назад +1

      яндекс дерьмо феерическое.Самая еб*нутая авторизация на яндекс клауд ,из всех что я видел. так и не удалось зайти)

  • @marekkancir8272
    @marekkancir8272 4 года назад +1

    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!

  • @ashishmagar581
    @ashishmagar581 4 года назад +2

    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.

    • @BaceJeleren
      @BaceJeleren 3 года назад +1

      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

  • @GhullieUser
    @GhullieUser 3 года назад +1

    This is great! Thanks man

  • @KobiLDN
    @KobiLDN Год назад +1

    very usefull, thanks for making this

  • @tommyc_123
    @tommyc_123 Год назад +1

    Awesome video! Thanks a lot.

  • @scotter
    @scotter 4 года назад +2

    Thank you! Possible to use this method (Google Cloud) to run a python-based web site associated with a domain name?

    • @JayMartMedia
      @JayMartMedia  4 года назад +1

      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

  • @iriealdana9228
    @iriealdana9228 2 года назад

    question how to import package to the python script? it always says "ModuleNotFoundError: No module named 'schedule'

  • @liamtrotzuk59
    @liamtrotzuk59 4 года назад

    fantastic tutorial. thank you so much for sharing - incredibly helpful.

  • @digitalnomad2196
    @digitalnomad2196 3 месяца назад +1

    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.

    • @JayMartMedia
      @JayMartMedia  3 месяца назад +1

      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

    • @digitalnomad2196
      @digitalnomad2196 3 месяца назад

      @@JayMartMedia awesome thanks, do you have any new videos on this on your channel.

  • @jayjaychoo7284
    @jayjaychoo7284 4 года назад

    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.

  • @EL-sc9on
    @EL-sc9on Год назад

    can you make an update video to this showing how to restart and run the script even after it crashes

  • @jal051
    @jal051 Год назад +1

    One question. What is the difference between Compute Engine, App Engine and Cloud Run?

    • @JayMartMedia
      @JayMartMedia  Год назад +2

      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
      @jal051 Год назад +1

      @@JayMartMedia Thank you!

  • @danzrust
    @danzrust 4 года назад +1

    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.

    • @JayMartMedia
      @JayMartMedia  4 года назад

      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

    • @danzrust
      @danzrust 4 года назад +1

      @@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.

    • @JayMartMedia
      @JayMartMedia  4 года назад

      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

  • @lucasfernandeslima7474
    @lucasfernandeslima7474 4 года назад

    very nice, Jay! thank you!

  • @Harry-tj2yz
    @Harry-tj2yz 5 лет назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  5 лет назад +1

      When you install with pip you should be able to just import in your python script. No moving files around required!

  • @Justin-General
    @Justin-General 3 года назад +1

    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!!

    • @JayMartMedia
      @JayMartMedia  3 года назад

      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

  • @muhammedozdemir5933
    @muhammedozdemir5933 3 года назад +1

    YOU ARE GREAT MAN !

    • @JayMartMedia
      @JayMartMedia  3 года назад

      Thanks, glad you found the video helpful!

  • @parthpatel5532
    @parthpatel5532 3 года назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  3 года назад

      You will need to use pip to install those libraries onto the virtual machine

  • @KM-yw3ft
    @KM-yw3ft 3 года назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  3 года назад +1

      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.

  • @adalar42
    @adalar42 2 года назад +1

    Great video, thanks

  • @JayMartMedia
    @JayMartMedia  5 лет назад

    Check out my 100 subscriber video to enter to win a SanDisk SSD: ruclips.net/video/oy7cYek3nnw/видео.html
    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!

  • @noone9474
    @noone9474 4 года назад +1

    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.

    • @JayMartMedia
      @JayMartMedia  4 года назад

      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!

  • @edwinite
    @edwinite 3 года назад

    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

  • @varshilshah8311
    @varshilshah8311 5 лет назад +1

    post 12 months / after my free credits i still have to pay right ?

  • @imVoyager3
    @imVoyager3 2 года назад

    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?

  • @giovanninirta945
    @giovanninirta945 3 года назад

    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?

  • @t5alx136
    @t5alx136 2 года назад +1

    MongoDB also has a free service up to 512MB. In case any one wanted to know.

  • @viniciusmacario4660
    @viniciusmacario4660 2 года назад +1

    Great video!

  • @RabeeQasem
    @RabeeQasem 3 года назад +1

    thank you man :-)
    but I have a question when we say ( 4 v CPU) for example we mean by that 4 core CPU ?

    • @JayMartMedia
      @JayMartMedia  3 года назад

      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

  • @razaulkarim592
    @razaulkarim592 4 года назад

    I have followed this and it tries to make a transaction. What's the problem? It's a free trial I thought.

  • @08ykr22
    @08ykr22 4 года назад +1

    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?

    • @JayMartMedia
      @JayMartMedia  4 года назад

      You can either create it as you did the python file, or you can follow this video about uploading files: ruclips.net/video/5oI5ZC-jnJQ/видео.html
      Or you can look up how to upload files via FTP

    • @08ykr22
      @08ykr22 4 года назад +1

      @@JayMartMedia Thanks!

  • @avishkarraut4755
    @avishkarraut4755 3 года назад

    Does scripts works even after we shut down system ?? Also I don't understand why you have filled info in google cloud platform ??

  • @P3teR0cK
    @P3teR0cK 5 лет назад +3

    Hi,
    I followed your instruction concerning setting up a cronjob. However, it did not work. I did some research and apparently the paths are not specified well enough. What fixed it for me was using the full path to python bin file like so "/usr/bin/python3" and also using the full path with home directory like so "/home/USERNAME/my-first-directory/my-script.py.
    The full cronjob would look like this:
    */5 * * * * /usr/bin/python3 /home/USERNAME/my-first-directory/my-script.py
    I have a question. I don´t see the terminal do anything when the cronjob starts executing the script. However, the python script did run at the specified time. How can I see the code running in terminal like when executing the script manually?

    • @JayMartMedia
      @JayMartMedia  5 лет назад +1

      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!

    • @P3teR0cK
      @P3teR0cK 5 лет назад +1

      @@JayMartMedia having log files is good. thx ;)

    • @JayMartMedia
      @JayMartMedia  5 лет назад

      Awesome@@P3teR0cK, I'm glad that worked!

  • @goaapie
    @goaapie 3 года назад +1

    @JayMartMedia Do I need to run the TMUX command in order to have the CRON JOB work? Or is this something seperate?

    • @JayMartMedia
      @JayMartMedia  3 года назад

      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.

  • @ooovenenoso
    @ooovenenoso Год назад +3

    Solo paso nuevamente para dejar mi agradecimiento. Soy nuevo con Google Cloud y este video me ayudo a comenzar. Para que tengas una idea, me ayudaste a reducir los costos operacionales de mis Scripts en un 73.33%.
    ¡Gracias!

    • @JayMartMedia
      @JayMartMedia  Год назад +3

      Genial, me alegro que te haya resultado útil el vídeo. ¡Gracias por los ánimos!

  • @hhhqqq3918
    @hhhqqq3918 4 года назад

    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!

  • @jeffbong7989
    @jeffbong7989 4 года назад

    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!

    • @JayMartMedia
      @JayMartMedia  4 года назад +3

      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).

    • @jeffbong7989
      @jeffbong7989 4 года назад

      @@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.mp4
    @kelvao.mp4 3 года назад +1

    can I host a bot to run 24 hours? or would I have a limit and would I have to pay something?

    • @JayMartMedia
      @JayMartMedia  3 года назад

      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.

  • @as34242
    @as34242 4 года назад

    Beast, appreciate it man!

  • @soyhim
    @soyhim 3 года назад +1

    Nice one!

  • @SmarcosGameR
    @SmarcosGameR 3 года назад

    Hi, my script needs several packages , where i have to install it ?

  • @muhammadyousef6261
    @muhammadyousef6261 Год назад

    Thank you so much for this video,
    I tried the cronjob however it's not working.

  • @theunknown7129
    @theunknown7129 3 года назад

    Hey bro, i had made a voice assistant and i want to run it on a website. When i will press a button on my website it will run the voice assistant. Please can you tell me , how to do that...?

  • @P3teR0cK
    @P3teR0cK 5 лет назад +1

    good job. very helpful

    • @JayMartMedia
      @JayMartMedia  5 лет назад

      Thanks for the encouragement. I'm glad you found the video helpful.

  • @Cyrus_FG
    @Cyrus_FG 4 года назад

    Can you not install pip files, it won’t let me, keeps saying pip command not found

  • @aniketkumarphysics9805
    @aniketkumarphysics9805 4 года назад +1

    Detail video Thanks

  • @djariwala1990
    @djariwala1990 3 года назад

    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

  • @xampi02
    @xampi02 3 года назад +2

    After 3 months you have to start paying. I contacted support and asked about it.

    • @shopminer2308
      @shopminer2308 3 года назад +1

      Hello, do you know how much do I have to pay monthly after 3 months period ?

  • @hhjoyvzc348
    @hhjoyvzc348 3 года назад +1

    helps me a lot

  • @berrynsk
    @berrynsk 2 года назад +1

    how is it free if you are to be charged around 5$ monthly?

    • @JayMartMedia
      @JayMartMedia  2 года назад

      cloud.google.com/free/docs/gcp-free-tier/#free-trial
      It is now a 90-day free trial. They give you $300 in credits.
      They begin charging if you use more than the $300 free credits, or after 90 days. Whichever comes first.

  • @eazye7059
    @eazye7059 3 года назад

    why crontab isn't working? im do the same as you