Copy entire system drive - robocopy

I want to do something like "clone" entire system partition but it destroy filesystem. I want to save filesystem type, owner, permissions and everything else.
I did try to use xcopy(almost work, but stuck on running), on xrobocopy crashing at boot. Why? Needed many times in some kind of system repairs. Maybe someone have tested and working idea? Programs tested - nothing can do like only clone with destory system.

Related

How to periodically 'touch' temporary files on remote server so the files don't get deleted

I log on to the remote server using SAS/Emacs. On the server, there is this space where I can save files for about a week. Unless I refresh or 'touch' those files again, they will get deleted after a week. Is there a macro or a code that I can execute whenever I open SAS/EMACS so that these files stay updated?
So far, I have used SSH to go on to the server and type 'touch /*' to keep it 'touched', but I am hoping there is a better/more efficient way to keep those files touched.
Assuming you're using EMacs Speaks Statistics to connect to SAS, then you have a couple of different options.
One is to modify ess-sas-submit-command to point to a script that first does your "touch" command and then starts SAS.
Another is to create an autoexec for SAS to do that for you, assuming you have rights to do so; you can add that to various locations in Unix or to the command line itself (depending on how you're launching SAS).
Even if you're not using ESS, the Autoexec method may work for you.
Note that, of course, your system administrator may not appreciate doing this, so do make sure this is permissible (unless that sysadmin is you!).

Export to Java application deletes files

When I wanted to export the model I was working on as a Java application, I encountered an error regarding the databases I loaded into the model. When I said OK to the error, I realized that all the files in the folder I wanted to create the Java application were deleted. That folder was desktop by the way.
Right now all the files (i mean all of them!) on my desktop are deleted and they don't even show up in the recycle bin. How are we going to solve this situation? How can AnyLogic have the authority to delete all files in that folder? How is this authority not shared with me and not warned beforehand?
When you work with software in general, you need to have a version control in place that will allow you to recover your information. These problems occur, and if AnyLogic has access to your computer it's because you grant the permission and it needs the permission. If you make your desktop your project folder, then i would say you are to blame.. why would you do that...
Using GIT as Ben commented, is always a good idea... but it requires you to be conscious about when you commit a version.
What I do, is I use dropbox and all my projects are done in a dropbox folder... the good thing is that dropbox always saves automatically all the files on the folder... this has saved my life multiple times and I suggest you to do something like that in the future. So on one hand you have the autosaving features, which is useful, but sometimes you erase everything by mistake, and the autosave is not useful, but dropbox saves no matter what.

How to make Custom Application to persist reboot of WinCE 6.0 OS?

I am looking for a solution on how to setup the Windows CE 6.0 design image to integrate my custom application.
I want after building the image and starting it on the target machine to be able
to access my application from the \Hard Disk\Program Files\CustomApp folder.
In addition I require the application to be persistent. It must not be lost after reboot.
I am aware of copying the application to the Hard Disk out of the NK.BIN but if is possible I want a solution like adding dlls or other files to Windows folder.
I am usign an SQL CE database along with the application so I want the data to be persistent too.
Thanks in advance.
If the \Hard Disk folder contents are not persistent (and I assume they aren't since you're asking this questions), then getting the app to "persist" can be done only as a slight-of-hand trick, just like the contents of the Windows Folder. At boot, the OS will get expanded into RAM, and if you've included your app in that OS, it will get extracted too.
First, you must include your app files (exe, dlls, all dependencies, etc) into the OS image by adding them to a BIB file.
Next, you must understand that all files get extracted to the \Windows folder. There are no exceptions. If you want it in a different folder, you must use a DAT file to tell the OS where to put it one the OS has been extracted. Be aware that the DAT file does a copy, not a move, so if you want it elsewhere, you'll have two copies of the app on the device. A typical solution is to use the DAT file to place a shortcut, not a full copy.
The last part of your question is the hard, or maybe impossible, part. Your database is not going to persist. You could include a copy in the OS, but every time you hard reset, a new copy of the database as it was when the OS was built will get copied out. No new data will survive.
To get that to work, you need a persistent file store on the device. If you're the OEM, you might be able to implement one with any remaining on-board storage (where the OS image file resides) or with separate mounted USB/CF/SD/HDD media. How you do this is highly hardware and BSP dependent, plus it's way more complex than can be described here on SO.Without knowing anything about the target device, it difficult to even give you any pointer on where to begin. Here's a very generic starting point for Flash storage.

Making and Interfacing with Custom Services

I've been searching for this for awhile now, and I am not sure if I am just not using the correct search terms or if the answer is really that hard to find.
What I am trying to do is to create a new Windows service for a game server from a batch file, and then have a task run another batch file every 30 minutes or more that would run two commands on the game server's command line and do some file work.
Specifically, I am running a Minecraft server using Bukkit for a gaming community I help run, and I want to make sure that the thing is always up unless I specifically tell it to stop (like a service). Bukkit is run directly from a batch file and has it's own command line thing running on it.
I am told that you CAN run this type of thing as a service, but the command line will be hidden from view and/or interaction. This is the second part of my query. I have a handy little backup.bat file that copies all the world files and userdata files into a backup directory, 7zips it, and deletes the directory. The only thing is, is that Minecraft likes to always have the worlds' region files open and writing at all times, meaning that it could cause map corruption if I just run it straight off. To compensate, I need to run the command "save-off" on the server to disable the file hooks temporarily, run the backup, and as soon as it finishes, run "save-on" so that the game can continue without lost data.
What I would like to know about this second one is, is it possible to interface with the game service through a batch file, or do I need to create an application to do that? If the latter, how exactly does one go about doing that? I have moderate C++ knowledge (up through my second OO-C++ course in college), and can possibly learn another language if absolutely necessary.
So, in short, two questions:
1. Is it possible to, and how to run a BAT file as a Windows Service?
2. How to interface with said service via BAT files, and if not possible, what kind of application do I need to write (redirection to or writing a tutorial works for me).
Thank you in advance for any and all help!
Old question, user account doesn't seem active on SO anymore, but hey, if you stumble upon this because you have a similar problem:
Since we are speaking about a Bukkit Minecraft server, turn to the "Essentials" plugin for Bukkit.
It now includes a Backup function that does exactly what the OP asks for, namely stop the save so the files can be manipulated without corruption, launch a script, then starts again.
The script can be a backup one (examples provided in the linked page) but can be used to run any operation on the world's files.

How do "directory VIEWS" auto-update their file list?

I am just curious about this.
I had a network folder open on one computer viewing the files in the folder. From another computer I opened the same folder on the network and deleted a file. On the first computer the deleted file immediate disappeared from the list.
The only way that I can think of how it knows that is that it is constantly checking the contents of the open folder. But that sounds like it would waste a lot of resources to do, but I cannot think of any other way it could do that. So I was just wondering...how does that work?
Thanks.
It's probably a push notification. Rather that the client computer constantly checking, the server sends a message to the client when a change is made.
You never specified what platform you're interested in. In general, the only thing that is portable is polling to see when a file or directory has been updated. Polling once a second or so is generally not too expensive, though over a network file system it may be too much.
Various platforms offer a variety of solutions for being notified when filesystems change. Moder versions of Linux provide inotify. Mac OS X provides the FSEvent system. On Windows there is a directory change notification system.