16,018,525 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by vantoora (Top 14 by date)
vantoora
1-Oct-12 7:35am
View
Dear Sergey,
So here I am for the details of my project that I was thinking to make with the process we discussed earlier.
I have 4 servers for production use, and 4 servers for backup (hot backup)
The productions server contains millions of files (most of them a xml and jpg files, means little files). I have to backup all of those files by using "robocopy" (a µsoft's program) every 30 minutes.
Files are classified as a project (e.g. ProjectA, ProjectB, ProjectC, ...) and my tasks scheduler are configured accordingly.
Everytime there is a new project, I need to make a new script for that project, and everytime a project is finished I need to delete data of that project on my backup server (once someone else informed me that they have finished the project and archived it).
For the backup I do not need to compare the source with the destination folder but only copy new files (incremental backup), so I need to check often the destination if it is not full (the space disk), and if it is full I need to make a mirroring one time.
So what I need to achieve is to centralize one system which :
1. can create a script automatically once a new project is added (done)
2. can create a mirroring script if there is a low disk space or a purge from the source was made (done but manually)
3. can verify if a new project is added but I was not informed (done)
4. send me the logs of backup process by mail (done)
5. send me the logs of errors happened during backup process by mail (done)
6. create a script which verify all space disk and create script for purge accordingly and execute the script once there is a full/low disk space (not yet done...)
... means a backup system management.
For the point (2) it's done manually everytime so need to check my 4 servers everyday.
For the point (6) this is where I need to develop a program like NSClient++ so I can run the script automatically. Just setting up a task scheduler on my box and it'll run automatically for me. I just need to check my mail so even at home I can have an idea of what happen on my servers.
So waiting for your suggestion for that.
If I am not more clear, you can ask.
Thank you.
vantoora
1-Oct-12 3:52am
View
Dear Sergey,
Thanks for your last solution but I think the first is more appropriate of what I need.
I'll stand by this project for 3 weeks from now as I'm working on a new project on Linux. It's on Centreon+Nagios (a monitoring web application).
And from this study, if you already heard about Nagios and/or Centreon you'll get exactly what will my goal. Centreon have a service permanently running on a server (a linux one) and to check the status of a remote server I need to install NSClient++ (permanently running as a service on a remote windows server) and the server ask NSClient++ to get some information (cpu usage, memory usage, disk space, ...) and it will return the desired information back.
So this is exactly what I need to achieve.
As I have this idea in my head I'll try to describe you what I'm going to do with this kind of software this afternoon so you can judge if it's feasible or not.
Thanks again for considering my project.
vantoora
21-Sep-12 11:45am
View
Thanks to you.
Yeah this is what I expected to have.
To tell you the truth I don't know yet what I'm going to do with this kind of project for a real use in my work but I just want to know something else. I'm not a guru in C# but tried to be one.
I'm now experiencing on creating many kind of Application Service and then will try to manipulate it with ServiceController and will back again here as I already have some question but better next time when I'll finish to study.
Thanks
vantoora
21-Sep-12 3:59am
View
Thank you for your reply Sergey.
I think I would start from the links you provided and then come back to you for the situation status.
And I am conscious that notepad will not appear on my own screen, and this is not my approach. I just need to initiate the remote program to run something on the server hosting the program. Maybe I just need a log file, or something like that but it is not yet what I need for the moment.
Thanks again for your help.
vantoora
29-Aug-12 1:49am
View
That's for sure.
I'll arrange my time to study LINQ and then I'll be back for this project with the right method as I tried another method for now going on.
vantoora
29-Aug-12 1:47am
View
Yeah I understand that and I already tried to bypass is by parsing the output to not considering but only the time and that was ok.
vantoora
21-Aug-12 8:31am
View
Thank you Martijn, it's working now.
I have tried to to cast with (Int32) and then display each row as you said and I found that some Field contains value like "03/01/1900 22:14:32" don't know yet why.
So I must look at it.
Thank you Martijn,
And thanks for the links you suggested, it's very interesting. After reading the content of the site, I wish it'll my turn to answer/help someone else.
vantoora
21-Aug-12 5:14am
View
Hi,
Here I am back for one day after trying to make the code working.
Unfortunately I cannot make the code run as it always returned to me an error saying : "Specified cast is not valid."
And this error occurs on :
avg = new TimeSpan(0, 0, (int)grp.Average(r => r.Field<datetime>("id").TimeOfDay.TotalSeconds)),
AND
max = new TimeSpan(0, 0, (int)grp.Max(r => r.Field<datetime>("id").TimeOfDay.TotalSeconds))
on (int) cast.
Tried to change but don't know why it cannot run.
Better for me to buy a new book on LINQ otherwise I'll always encounter the same problem as I'm going to use something like this so often beginning from now.
So if you have any idea to bypass/resolve this problem I'd me appreciate it very much but for now I think that I'll try to make some script on my database server (a stored procedure) to make the calculation before I retrieve them in my code as a datatable.
Thanks you so much for spending your time to help. Bye
vantoora
20-Aug-12 8:12am
View
Hi Martin,
This is the kind of error I have encountered when I modified little by little my code.
Thank you so much for your solution. I have not yet tested it but I'm going to test is right now and will be back here after some times.
Thanks again.
vantoora
29-Jun-12 4:01am
View
Already checked and XP Win2008 have the same cmdPath but only the option differs.
For Windows 2008 option have "/" instead of "-" but tried to run in dos window and still can run even with "-" (e.g. defrag -a c: and defrag /A c: both for XP and 2008).
And the strange thing I just pointed out this morning too is that using the same code, no modification made but just changed the cmdPath into "chkdsk" (check disk) instead of "defrag" it's running well.
vantoora
29-Jun-12 3:57am
View
No do not have the command defrag.exe under win2000 (c:\winnt\system32)
It's "dfrg.msc", and modified my code according to this to just open the window of the defragmentation app but still having the same error.
vantoora
28-Jun-12 14:13pm
View
already tried to run with administrator rights/account but cannot.
vantoora
28-Jun-12 11:57am
View
cmdPath is just a string of "defrag".
Have tried with a fullpath like "c:\windows\system32\defrag.exe" but still remain the same error.
vantoora
28-Jun-12 11:56am
View
The error message is :
Exception non gérée : System.ComponentModel.Win32Exception: Le fichier spécifié
est introuvable
à System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInf
o)
à System.Diagnostics.Process.Start()
à KBDefrag.Program.CheckDefrag(String cmdPath, String parameter)
à KBDefrag.Program.Main(String[] args)
(it's in french and means "specified file not found")
And it breaks after trying to execute "process.Start()"
Show More