I needed to know if there is a program which would perform a set of simple tasks which a user can do.
For example. I want to copy file1 of folder1 to folder2. And then stop some services. And then copy file2 to folder3. If folder3 does not exist then folder4. And then download something and then maybe uninstall/install something.
May I please know if there is a program which can do that.
Thanking you.
Best regards,
Satya Ashok Kumar.
There is make for windows, too. nmake as part of Visual studio, gnu make from cygwin or mingw. Or something newer, like cmake.
But what you describe looks more like a simple batch file (like a shellscript on Unix) would be sufficient. The interpreter for that, cmd.exe, is already part of windows. More advanced: Powershell.
Related
Hello I have a directory for my photos in the structure of
Pictures/year/month/[dd/mm/yyyy]_description.
Sometimes I did not use [dd/mm/yyyy] but [dd/mm/yy] for example [22-03-13] instead [22-03-2013].
I need to rename all of this with a command because there are a lot to change it by hand.
I was able to find them by using "Everything" finder with the
"E:\Pictures\" [??-??-13]_*
I would love a command like:
rename [??-??-13]_* to [??-??-2013]_*
where ? and * remain the same. Is this possible? Thank you very much for your time.
PS I can use either Linux or Windows.
Many linux distros come with a great tool called rename that does just what you want.
For example:
$ rename -n 's/(\d{2})-(\d{2})-(\d{2})_(.*)/$1-$2-20$3_$4/' ./*
'./08-01-14_tahiti.jpg' would be renamed to './08-01-2014_tahiti.jpg'
'./14-11-13_guam.jpg' would be renamed to './14-11-2013_guam.jpg'
'./23-07-12_hawaii.jpg' would be renamed to './23-07-2012_hawaii.jpg'
I need to find a solution at work to backup specific folders daily, hopefully to a RAR or ZIP file.
If it was on PC, I would have done it already. But I don't have any idea to how to approach it on a Mac.
What I basically want to achieve is an automated task, that can be run with an executable, that does:
compress a specific directory (/Volumes/Audio/Shoko) to a rar or zip file.
(in the zip file exclude all *.wav files in all sub Directories and a directory names "Videos").
move It to a network share (/Volumes/Post Shared/Backup From Sound).
(or compress directly to this folder).
automate the file name of the Zip file with dynamic date and time (so no duplicate file names).
Shutdown Mac when finished.
I want to say again, I don't usually use Mac, so things like what kind of file to open for the script, and stuff like that is not trivial for me, yet.
I have tried to put Mark's bash lines (from the first answer, below) in a txt file and executed it, but it had errors and didn't work.
I also tried to use Automator, but it's too plain, no advanced options.
How can I accomplish this?
I would love a working example :)
Thank You,
Dave
You can just make a bash script that does the backup and then you can either double-click it or run it on a schedule. I don't know your paths and/or tools of choice, but some thing along these lines:
#!/bin/bash
FILENAME=`date +"/Volumes/path/to/network/share/Backup/%Y-%m-%d.tgz"`
cd /directory/to/backup || exit 1
tar -cvz "$FILENAME" .
You can save that on your Desktop as backup and then go in Terminal and type:
chmod +x ~/Desktop/backup
to make it executable. Then you can just double click on it - obviously after changing the paths to reflect what you want to backup and where to.
Also, you may prefer to use some other tools - such as rsync but the method is the same.
I have a script which was origionally made for Linux, but adapted to run with Cygwin in windows, and if you already have the executables (sh, cp, mv, etc.) then you can run it without Cygwin. The only problem is that the script also uses a few hundred (yes hundreds) of other executables. Is there any way I can compile this script into a regular executable and pack these other supporting files in as resources?
The script is ~1600 lines long which is probably too long to confortably re-implement by hand in C++. I am looking to compile the script into something which windows can execute without having to make edits to the path to include a bunch of third party executables. A way to contain all this.
I doubt that the solution you have in mind is feasible.
Instead, I'd modify the script so that the first thing it does is figure out where all those hundreds of executables are. Then either set $PATH appropriately, or invoke each one by its full pathname.
Or you can have an installer that installs the executables in a specified or user-chosen location, then re-generates the script (from an input file) so it knows where the executables are. Ship with the-script.in, then have the installer perform textual substitutions to generate the-script from the-script.in.
I point out:
RPM and SHC
as a possible solution for your problem. Maybe this tools helps you to do the job.
Using SHC to Cygwin is possible to compile bash to exe
Ok. Realy old, but I was looking for it and decide to do my self and make it public.
http://goo.gl/M1NSY
Use ports of the required utils and use some application virtualization tool to package it all up. Cameyo is a free one. Forget Cygwin, that thing is huuuge :)
Yes, I know, the archive bit is evil.
That being said, is there support for querying it with 'find', and modifying it with 'chmod'?
My googling has turned up nothing......
As already mentioned by Jed, you can use attrib both to query and to set the archive bit. You must however remember to use the cygpath tool to convert between cygwin style file names and DOS style names, as required by attrib.
If you convert the output of find with cygpath, invoke attrib for each file name and use egrep to check for lines starting with A (regexp '^A'), you should be able to search for files with the archive bit set.
When I used cygwin, I made sure it had access to the Windows tools as well. In that case, you can use attrib to at least set or clear the archive bit for you.
To list files with the archive bit set you can use dir /A:A, which you can accomplish by doing CMD /c or something similar.
I don't think you're going to find the ability to do this in Unix tools.
I'm working on some driver development and using Microsoft's build.exe tool from the WDK 6001 (Vista). I'd like to be able to clean up all the object and intermediate files it spews out on every iteration.
So far, I've found "build.exe -0 -c" works relatively well, by simply deleting all the .obj files, but none of the .sbr files or directories it created. I'd really like to avoid writing a makefile as another makefile would be hard to integrate into the build system.
How can I do this?
Have you though of a scripting language to to a recursive delete. We use Nant for our build system, and that has this type of thing built in.
A more windows answer might be to use powershell which you should be able to call from your makefile.
Or you could just revert to DOS commands. Thus
dir /S *.sbr
Shows me all my nested sbr files, and then
del /S *.sbr
deletes then all. And can be shown to have worked via the dir command again.