ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
I take automated tape backups. I have written scripts which load tapes and take automatic full and incremental backups. I am storing the recursive listing of the tar command into index files. I need a web based client which can read those index files and generate some kind of a listing of those files. I can only read from the LOGS NOT FROM A REAL DISK
The index files are like this
a file named usr010 has contents like
usr010/
usr010/lost+found
usr010/ada
usr010/ada/abc
.
.
.
i have many other files which have a recursive listing of the file system I am backing up !!!
Can u give me any idea how to code it in PHP or is their any ready made software avaliable for this !!!
Without knowing more about what you want to see, all I can suggest is to copy or soft-link them to files in your web server's document root, and view them directly. OTOH, if it was me, I would shove them into a relational database, either postgresql or mysql, which allows for very generalized querying of the database, even ad hoc queries. Doing this, you will develop a good sense of the kinds of data you consistantly wish to see, and develop routines to extract these data and format them suitably for display. I do this kind of thing with my server's log files.
I am already using Apache + PHP. I am only stuck as to how exactly should i parse the logs. I dont want to move to SQL. I can parse the index files using shell scripts only (i am comfortable with it) I am only stuck trying to build the interface. Can u direct me to some other forum.
the reason i asked here is that, there are so many file managers avaliable for Linux. can I tweak any one of them so that they work on my Index files instead of an existing file system. I only want a web based interface. And when u click on a icon (or a folder say) it should backup that file to a location (that script i have ready - i only need to put them together !!!)
My problem is how do u think i shud code this
say my first line has the root. next line has the contents of that folder. so i want that when the user clicks on one, he should be able to move to the next folder and all the way down till he reaches a file. when he clicks on that, it should load the correct tape and copy the file (this script i have ready ) i just want it to run when someone clicks it !! I am pretty new to php programming
It's very hard to determine exactly what you are asking. Your statements 'I am only stuck as to how exactly should i parse the logs' and 'am only stuck trying to build the interface' address two different issues.
Your shell scripts to parse the files should be fairly simple to translate to PHP. Parsing files is often made simpler and/or better by using regular expressions, so if you aren't already comfortable with those, now might be a good time to bone up on them.
Do you know how to generate pages containing HTML forms? Do you understand the mechanics of a form handler?
If the answer to either of these is 'no', then you should do some research and study, until you understand those two key concepts.
If 'yes', then I suggest that you break the problem down into the two separate issues of navigating within the universe of your directory & file index, and selecting/deselecting and accumulating the list of files/directories to backup. The latter is where forms are going to come into play.
If this helps you look at the problem with more clarity, then start writing a bit of code, and come back here when you have more specific questions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.