Announcement

Collapse
No announcement yet.

Usefull scripts (I wish to learn how to make my own scripts)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Usefull scripts (I wish to learn how to make my own scripts)

    I recently learned and made some really basic BAT files, just for shutdown and restart.
    If I understand correctly the Linux version of BAT files are scripts. So I would like to learn some useful scripts.
    From the start, from where do you make them (Kate I suppose?) in which format you save them.
    Something like my frined made in BAT file for Vista where he made a "gaming" session BAT that when runed kills everything that you don't need when playing games.

    So please if there are any useful scripts that you know, share them with me.
    But as I said I would not like to just use preconfigured scripts, but also to make them myself.
    Thanks in advance.
    I'm magnet for errors, problems and bugs...

    #2
    Re: Usefull scripts (I wish to learn how to make my own scripts)

    Always a handy script to have is one which backs up your email, mozilla, calendar and address folders.

    The folders in question vary depending on your setup, mine are in a special partition called /personal which I back up every 15 minutes across two disks (I use this for work, I'm not 'just' paranoid ).

    Start your bash script with a shebang and take it from there And ask all the questions you want...
    Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

    Comment


      #3
      Re: Usefull scripts (I wish to learn how to make my own scripts)

      What's shebang? (#! ?)
      Is script equal to BAT? Meaning that I use bash commands to achieve whatever I want...
      How would an shutdoen script look like?
      maybe something like this:
      Code:
      shabang (whatever that is) shutdown -h now
      I'm magnet for errors, problems and bugs...

      Comment


        #4
        Re: Usefull scripts (I wish to learn how to make my own scripts)

        shebang = http://en.wikipedia.org/wiki/Shebang_(Unix) - in our case #!/bin/bash

        BAT? What is BAT?

        Try to write a script that backs up your vital data to a separate, safe place. You will need to look a little deeper into the cp command as you only want to copy changes, not everything anew. Other than that it should be straight forward

        Feel free to ask questions.

        The finished script can then either be incorporated into the booting/shutting down process or be executed on a regular basis using cron - but first for that script
        Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

        Comment


          #5
          Re: Usefull scripts (I wish to learn how to make my own scripts)

          Originally posted by toad
          shebang = http://en.wikipedia.org/wiki/Shebang_(Unix) - in our case #!/bin/bash

          BAT? What is BAT?
          BAT is an windows batch file which if I understand it correctly it's similar to scripts.
          Bat for shutdown of computer:
          Code:
          @echo off
          shutdown -s -t 05
          msg * Computer will shutdown in 5 seconds.
          echo off means that this procedure won't be shown in command prompt.
          together with msg * they make of some kind GUI.
          I'm magnet for errors, problems and bugs...

          Comment


            #6
            Re: Usefull scripts (I wish to learn how to make my own scripts)

            yes there basicly equlivent to one another
            you would be saving them as a .sh file
            and you should be able to find lots of commands for them try using
            Code:
            man <program>
            to find out arguments and see examples for a program.
            also to run a script you
            Code:
            sh <script>.sh
            Mark Your Solved Issues [SOLVED]
            (top of thread: thread tools)

            Comment

            Working...
            X