Perforce auto sync - version-control

I work in a large evolving code base and use perforce to manage it. The problem is that I need to update it everyday and it takes a long time to do it. I am looking for ways to automate this process.
I first thought of writing an script and make it a scheduled task. I could not do it since running "p4 sync" gives me "p4 protect" related error. I don't have, and will not get, admin rights to server so I can't add myself to the protect table.
Since I can sync through P4V - perforce UI- I guess there should be a way to achieve this through custom tools or something similar.
Can you guys please provide pointers on how to approach this problem or if there is already a solution for it.

If 'p4 sync' gets a protect error in your script, but not when you use P4V, you most likely have the wrong environment in your script. P4PORT, P4USER, and P4CLIENT need to have the exact same settings in our script as they do in your P4V connection.

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!).

Simple yet fast deployment tool or solution for FTP-based server

I have a simple task to which some simple solution should exist yet I cannot come across one.
I have a huge file tree on computer A (development). I have the same (multiple) such file trees on a computer B (let's call it production). Computer B runs FTP and PHP, nothing much else.
I need to move the changed files from the tree on A to the tree on B but as efficiently as possible. I.e. if just one file changes, it will just transfer that one file. It would be enough to "compare" the local and remote trees using last modification dates, nothing else needed.
I tried to use the good old Ant for it but that really does not work as the FTP task is really bad one there (does not preserve modification dates on PUT and so on). What other options are there if I do not want to write the code for such a task myself? I'd expect there is some tool out there that would make a remote dir listing, download it to local computer, select only those changed files and transfer them to the destination. Do you know how I could do it? Some sort of FTP or PHP-based distributed robocopy?
EDIT: I should have added that I mean doing it on a Windows 10 computer syncing to some FTP/PHP server using command-line automated script, not GUI.
Actually I solved the issue using winscp. I managed to integrate it into ant calling it through the task and using the winscp's synchronize command. For my current folder size it is fast enough, let's see later. The FTP command in ant was not useful since it does not preserve the modification dates.

Automated Updating of a Program via powershell

I am trying to updating a software that is company wide. When the update is applied to the server, the client machines recognize they need an update and ask if you wish to update or not. To update, the user would need to run as admin, which is'nt an option in this case.
We would like to automate this process using powershell, using the Invoke-Command feature. For the most part, the only thing that the update does is copy new files to the programs folder, which we have achieved with robocopy. However, there is one registry key that needs to be added in multiple locations. There is a setup file that does this, but requires a user (with admin privileges) click a couple buttons, and we want this to be completely automated.
So I guess the short version of my question is, what is the best way to handle the registry changes that setup.exe does? It would be nice if there was a way to invoke the script that the executable does.
As for my question, I solved the problem with a slightly diferent approach. (One that should have been tried initially)
When (ProgramName).exe is run, if it sees that it needs updated, it runs a program called (ProgramName).setup.exe with the parameters :
Client="Local folder" server="server location"
These parameters did NOT work from the command line, however, and so I ended up using a powershell script to make a scheduled task that ran (ProgramName).setup.exe with said parameters.
Another huge advantage to this was the fact that I could create an icon that allowed a regular user to run the scheduled task with admin privileges. I couldn't setup a shortcut directly, however, I wrote an AUTO-it Executable that would run the task as admin.
I hope someone can get some level of help out of this post!

System for automatically logging exact file code changes by line item

Does anyone know of a software or system for automatically tracking and logging exact line code changes into a log file?
For example, lets say I edit 7 files on Jan 16th, and I add and modify several lines of code in each file.
Is there a software or tool of any kind that would automagically know what edits I made, what was changed, and log the details in date order line-item file?
I am guessing something exists like this, but I cannot find out what I should be searching for. I looked at SVN and some other similar, but didn't get these capabilities from the descriptions I read.
There's nothing that would automagically know this. This sort of information is easy to come by as a side-effect of using virtually any version control system though. It sounds like you're not using any VCS, you should start doing so now. SVN is a good option to start with.

emacs local version control

I am wondering if there is local version control/snapshots for emacs independent of VC?
let me clarify:
every time I save buffer, I would like to be able to keep track of changes of each save in session. I know I can do something similar with backup files, but they are not automated like VC and a somewhat cumbersome.
I have searched Google, but did not find the solution.
Perhaps my query string was not good.
I found this for eclipse, am looking for emacs equivalent:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-55.htm
Thanks
AFAIK there is no such solution, but you can make some ad hoc one - like creating a local VCS repository and advice the save-buffer command to commit the changes in the repository.
I also came across a section of the manual that might be of interest to you.
I don't know of a way to get Emacs to save buffer snapshots, but keep in mind that it has an infinite undo facility. If you just want a way to get back to earlier versions, that might help you. If you want real version control, then I'd go with Bozhidar Batsov's solution and advice the save-buffer command.
http://www.emacswiki.org/emacs/BackupEachSave