CalDAV/CardDAV Radicale backup - bash

Now that I am runing Radicale on my own Linux server (to manage calendars and contacts), I am trying to figure out how to backup Addressbooks via a bash script (which I could then cron or manually launch).
The exporting part is not going to be so difficult thanks to Duplicity.
But where the ... is located the Addressbook ?
There is no *.vcf related to Radicale anywhere on my system.

I've found it.
It is in located in the personal directory :
~/.config/radicale/collections/contact/AddressBook.vcf
In ~/.config/radicale/collections/contact you there are as well the calendars.
Hum. This seems to me to be (remotly) a programing question, since its answer is program for who want to program its own bash backup script.

Related

OSX Scheduled Task / Script

How would I write a scheduled task on OSX to watch for a specific file and then have the scheduler rename it with an id?
Another program current creates a file, but it keeps getting overwritten. I don't have access to the other program's source code.
I'm a total noob in non-web scripting. Thanks in advance for the help.
Check out Folder Actions and Automator. Together they can be pretty powerful. There are lots of blogs out there describing their use.

Does running a .bat file in Windows generates any system log?

I want to create a .bat file in Windows that receives a password and will call a custom utility to encrypt that password.
Is really important that the password sent to the .bat file as parameter is not logged anywhere.
My question is, if running a .bat file will create any system logs? anywhere? What if the .bat fails?
Are there any other better ways of doing this?
Thanks!
The generic answer is, "No, the running of batch files is not logged." However, there is no guarantee on a given system that the information is not saved somewhere. Or to say that again without double negatives, it is possible on some system that the information could be saved. For example, there could be a custom command shell (possibly created by the "bad" guy) that does log information.
You're going to see the command line in the process list. So if something is logging processes, or if it's long-running and someone opens the Task Manager, they could see it.

Scripting for safe file backup under windows

I need to back up some large files that are being written to disk by a process. The process is perpetually running, and occasionally dumps large files that need to be moved over the network. Having the process do this itself is not an option, as the process locks out users whilst it is doing file dumps.
So, this runs under a windows machine, and as a primarily linux user, I am not entirely certain how to do this...
Under linux I would simply use a cron job in the folder (I know the glob that will match the output files), then check lsof, to ensure that the file is not being written to, such that I don't try to copy a partially complete file. Data integrity is critical, so I would normally md5 the files before and after the copy.
So I guess my question is -- how does one do this sort of stuff under windows? I feel like I am kneecapped from the start -- I can use python, but I can't emulate lsof, nor cron to do the task scheduling.
I tried looking at "handle" -- but it needs admin privelidges at execution time, which is also not an option. I can't run the backup process as an admin, it has to run with user privs.
Thanks..
Edit: I just realised I could keep the python instance running, with a sleep, so task scheduling is not a problem :)
For replacing cron you can use the "Task Scheduler" in windows to start your script every few minutes (or specific times).
For lsof the question was discussed here : How can I determine whether a specific file is open in Windows?

How to run a script on device mount in OSX

I want to make a script that automatically backs up my kindle files when I connect it to my macbook pro. Writing the script is well within my ability, but I don't know what's the best way to run a script on mount automatically.
You could either use AppleScript and attach a folder action to the /Volumes directory, or you could write a Launch Agent that watches that path.
For the latter, you can refer to Tutorial: Backups with Launchd on MacResearch. The gist of it is that you create a plist configuration file to be interpreted by launchd; then launchd will execute your script when the specified path has changed.
What kind of scripting did you have in mind? If you are using AppleScript, would it be possible to attach a folder action to the /Volumes directory (or maybe the specific subdirectory on which the Kindle mounts) to back up the files? I've never tried something like that, so use the idea at your own risk, but for what it's worth...
Other than that, I don't know of a general way to run a script on a mount in OS X. Kevent, which is OS X's version of Linux's inotify, would be a way something like that might be accomplished, but obviously you don't want to write a C program for all of this. One might be out there though.

Time Machine API / Command-line scripts?

I need the reference, if it exists, to Time Machine's API or simply some commands that can change the disk in use with Time Machine and back!
I'd like the script I'm going to write to do the following:
Change from disk A to disk B
Force Time Machine backup
Change from disk B back to disk A
Thank you!
Lion added tmutil, a command line interface into Time Machine.
https://apple.stackexchange.com/questions/17759/what-tiny-thing-in-lion-makes-you-smile-or-has-caught-you-off-guard/18665#18665
If AppleScript is fine with you have a look at this post with script. It should serve as a basis for your own.
Apple time capsules include an 'archive' command that can back-up the time capsule disk to an external USB-attached disk.
If I knew what to put there, it seems the file to edit is /Library/Preferences/com.apple.TimeMachine.plist.
You can achieve the correct configuration using "defaults write" to overwrite the relevant settings, although it seems like you have to modify the BackupAlias, which seems to be a hexdump of something I couldn't quite decipher. It does contain the path to my TimeMachine disk, though.
The sanest solution would be to copy the original settings, and then swap files whenever needed.
This Krypted.com blog post has a good list of the main command line use cases.
Also, if you are interested in anything Time Machine the place to start is the unofficial pondini FAQ.

Resources