Skip to main content
GameDev.net gamedev.net
🔒 Locked

Maintenance scripts

Started by CProgrammer Dec 24, 2010 at 12:10 AM 5 replies 1.7k views
Original Post
CProgrammer
CProgrammer
Hi guys,

i want to ask the community what you guys' favorite automation tools/languages are when it comes to maintenance tasks, e.g. automatic backups, changing directory structures.

I use several myself but to avoid influencing the outcome of posts i'll refrain from the discussion initially.

-CProgrammer
ApochPiQ
ApochPiQ
Depends a lot on the task and the platform on which I'm working.

For Windows, my primary development platform, I blend batch and C# a lot for tools and one-off type utilities; occasionally things are just easier to do in C or C++ so I may throw something like that in the mix as well. Now that I'm uniformly on Win7 on my dev boxes I'll probably switch over to PowerShell scripts.

On the Unixes, I prefer bash scripts and small C programs. Occasionally I'll venture into grep/awk/sed land, or even do a little Perl, but honestly my experience and understanding of those tools is pretty minimal, so I mostly stick to bash and C - since they can do the bulk of what I need anyways.
rip-off
rip-off
Ruby and/or Bash. Simple automation can usually be done in the shell, but for more complex logic using Ruby as part of the solution can be very powerful.
CProgrammer
CProgrammer
I really like C# and if it were considered commonplace on Unix as well I'd probably only use it.

Bash is great as a base but what do you guys think about mixing in php and C++ into the bash scripts, instead of perl or the like.
ApochPiQ
ApochPiQ
Why the hell not?

It's not like there's some international code of ethics on how not to get things done; if you're proficient with a given tool and can use it to good effect, then go for it. Maybe for certain jobs there are other tools which would be more productive, but nothing says you have to use them.
Nypyren
Nypyren
Quote:
Original post by CProgrammer
I really like C# and if it were considered commonplace on Unix as well I'd probably only use it.


Considering how often a tool in *nix land depends on something else, I wouldn't worry about depending on Mono. :)
rip-off
rip-off
Quote:
Original post by CProgrammer
I really like C# and if it were considered commonplace on Unix as well I'd probably only use it.

Bash is great as a base but what do you guys think about mixing in php and C++ into the bash scripts, instead of perl or the like.

For the kind of things I find myself automating, using such C++ or C# language would easily double the time taken to write them, if not more. I couldn't honestly see any benefit in doing so. The programs are small, so the "safety" of static typing just leads to verbosity more than anything. The programs also tend to be I/O bound, so there is no performance loss by using non native/JIT languages.

I would find PHP less expressive than Ruby, but it would be better than C++ I imagine. I could see it working for scripting if you are familiar with it. You certainly don't have to use Perl just because lots of people like to script with it.

It does depend on what you are doing (as with everything). Writing a small driver script to wrap a more complex native executable would be common. But I wouldn't write a native program if I could avoid it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.