CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Comparison and editing files script

 



romain0412
New User

Jan 11, 2012, 2:58 AM

Post #1 of 3 (894 views)
Comparison and editing files script Can't Post

Hello,

I have a backup solution (TSM) which will run every weekend a script. This script will save a list of VM and VM are four lists (one week). For now my VM lists are filled by hand but I want to write a script that automatically fill in these files while balancing the load (load space, I mean GB of VMDK to save each week) at the option of additions and deletions VM.

At the moment I thought of something like this:

The script will take as parameters:

- A file containing a list of all VMs on the present below a week earlier
- The quantity of GB VMDK lists for each of the four (4 files as parameters)

The script will:

- Get the current list of all VM
- If there is no difference stop treatment
- If there is a difference, he will find:
* If it is a VM within it will remove it from the list and change the total size in GB of VMDK from its list
* If it is a VM in addition, it will add the machine name to the list including the smallest storage space to save
- If there was a change it will send an email
- If there was a change, it will update the list of total VM it will take a point of comparison when the next time the script

The list of VM in 4 files are in this form:

"vma,vmx,VMU,VM8"

So the script should be able to delete the name of a VM and the comma that follows, and if such a VM to add it should add ",VMname".

In addition the command to list VM is PowerShell, right after there is no worries on that side.

Well, I'm not sure where to see, I do not know how to compare two files and to create versions for a VM within VM or more.

If all this talk to someone I'm interested.

In advance thank you,

Romain

P.S : Sorry for my english Cool


rovf
Veteran

Jan 12, 2012, 6:01 AM

Post #2 of 3 (831 views)
Re: [romain0412] Comparison and editing files script [In reply to] Can't Post


Quote
I do not know how to compare two files and to create versions for a VM within VM or more.


Comparing two files and see whether they are different:

Unless the files are exorbitantly large, you could just read them into a strings and compare the strings. Alternatively you can use File::Compare from CPAN.

Your sentence create versions for a VM within VM or more is not English which I can understand. What is VM? Virtual Machine? Vamipire Murder? Most of all, what does it mean to create something "within VM or more"?

Maybe it would help if you are more specific with your question.


wickedxter
User

Jan 12, 2012, 6:08 AM

Post #3 of 3 (830 views)
Re: [romain0412] Comparison and editing files script [In reply to] Can't Post

Im not sure what ur asking? U have a probelm with code u alrdy have or are u explaining ur idea and asking if its possible? depening on the readability of The source files will it be it be possible, I mean the files from the program r viewable to read and not obscure.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives