Results 1 to 4 of 4

Thread: Montior Folder Shell/Bash Script

  1. #1
    Join Date
    Jun 2011
    Beans
    64

    Question Montior Folder Shell/Bash Script

    Hello there everyone,
    I've used linux since Ubuntu 9.04 and just recently started to try to learn how to use shell/bash scripting, using core utilities that ALL linux systems can use, such as unrar, tar, and others...
    Well, I made a script for myself not too long ago to manage archives, videos, and other files that used to take me a long time to deal with -- With my script (which I am still tweaking every now and again) it has made things easier, but I finally ran into an issue that is a little too big for me to swallow...

    I am trying to create a script, that will monitor a folder and move any new folders and/or files of various sorts to another location.

    FOR EXAMPLE:

    monitor folder /home/user/downloads/NEW\ Downloads/
    Move new files to /home/user/downloads/Completed-Downloads

    I heard that inotify could do the trick, but using man inotify only confused me even more and while looking at scripts from other people, nobody really explains how it works... Scripts that I create, are supposed to be able to work on all platforms without having to install anything - if you install a linux version from a live cd, you should be able to run any script that I create right from the beginning...

    The problem I'm having is that (for convenience) people tell me to use one program or another, while I try to create scripts that run from a terminal (verbosely at times) so I can learn what it is I am doing...

    The script I am trying to create can be executed by a program on Download Completion, so I figured that might make things a little easier, because the script would check/monitor folder and then move any new folders and/or files to a different location and also notify me when the files have be moved.

    Is this even possible using strictly shell/bash or is it just really complicated and difficult..?

  2. #2
    Join Date
    Jun 2006
    Location
    UnderTheSea
    Beans
    265

    Re: Montior Folder Shell/Bash Script

    you might want look into in incron if u need to monitor your files changes
    So She Said Internet, And I Said Inter-Not



  3. #3
    Join Date
    Jun 2011
    Beans
    64

    Re: Montior Folder Shell/Bash Script

    -__-

    That is exactly what I meant. I am trying to create a script that will monitor the folder using components of Linux that are standard, and not something that I have to additionally install.

  4. #4
    Join Date
    Dec 2011
    Location
    The Netherlands
    Beans
    1,087
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Montior Folder Shell/Bash Script

    Quote Originally Posted by rhss6-2011 View Post
    -__-

    That is exactly what I meant. I am trying to create a script that will monitor the folder using components of Linux that are standard, and not something that I have to additionally install.

    On linux, there's no such thing as stuff you don't add. install.
    Heck, a default ubuntu install just unpacks the packages from the cd's offline repo.
    (ever did an ubuntu server install / textmode install / used debootstrap? cause they, unlike the gui one, DO show you what packages they're installing)
    And there's no way to know if a dl finished w/o some program tying into events of other progs that says if they're done.
    "Everything that has a beginning, has an end." --an unexpectedly wise wallpaper

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •