{"id":17321432,"url":"https://github.com/tompave/justincase","last_synced_at":"2025-03-27T03:17:00.160Z","repository":{"id":7937690,"uuid":"9328880","full_name":"tompave/justincase","owner":"tompave","description":"A Ruby daemon to listen to file system events in target directories and backup file changes.","archived":false,"fork":false,"pushed_at":"2013-05-16T21:53:50.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T08:41:46.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tompave.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-09T18:47:27.000Z","updated_at":"2013-05-19T16:47:28.000Z","dependencies_parsed_at":"2022-09-25T05:11:27.244Z","dependency_job_id":null,"html_url":"https://github.com/tompave/justincase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tompave%2Fjustincase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tompave%2Fjustincase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tompave%2Fjustincase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tompave%2Fjustincase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tompave","download_url":"https://codeload.github.com/tompave/justincase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245773173,"owners_count":20669719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T13:37:34.406Z","updated_at":"2025-03-27T03:17:00.137Z","avatar_url":"https://github.com/tompave.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#justincase  \n\nv 0.0.0 - not ready yet!\n---\n\n##What?\n__justincase__ is a daemon for Mac OS X and GNU/Linux systems, plus the command line tool to control it.  \nIt's a directory monitor and automatic backup tool, highly customizable.  \nIt's all written in pure Ruby. File system events are handled by [Listen](https://github.com/guard/listen), while the command line interface is powered by [Thor](https://github.com/wycats/thor).\n\n\n\n##How?\n\nThe __CLI__ component is a one-shot utility to control the __daemon__ (start and stop, duh) and to generate a self documenting JSON configuration file. At the first run it builds the working directory tree for the __daemon__ at a location chosen by the user (can be reinitialized).\n  \nThe heavy lifting is carried out by the __daemon__, that listens for file system events in the target directories and can be controlled through UNIX signals.  \nAs it records changes in the monitored directories, the daemon copies any new or modified file in a backup folder, and logs (in either TXT or SQLite format) all recorded modifications.  \n\n\n\n\n##Why?\n\nBecause I was fed up _a certain Mac app_ hanging when connecting to SMTP servers, failing to send emails and – just to make things funnier – deleting any trace of the failed messages from both the drafts folder and the temp dir in ~/library.  \n\nAll jokes aside, __justincase__ is aimed at continuosly saving the state of selected directories _just in case_ something goes wrong.  \n\nIf you:\n\n* are doing critical work,\n* don't trust some piece of software,\n* have already experienced crashes and data loss,\n* need a quick and lightweight backup solution,\n\n__justincase__ might come in handy.\n\n\n\n\n##The configuration file\nCan be found in `justincase/lib/justincase/resources/templates.rb`\n\n```javascript\n/*  justincase configuration file.\n    Author: Tommaso Pavese (wonderingmachine.com)\n    MIT License\n\n    These are the default settings that are used if no configuration file is provided.\n    All fields are optional: if you omit any key, the default value will be used.\n    If some keys are duplicated, only the last occurence will take effect.\n\n    The syntax is plain JSON.\n\n    About the Initialization Process:\n    When it starts, justincase will look for the '~/.justincaserc' file, which contains\n    the path to its working directory. If that file doesn't exist, of if it cointains\n    invalid data, justincase will ask to be initialized with the command 'justincase setup'.\n    (This is the default behaviour for the first run)\n\n    If the file '~/.justincaserc' exists and is valid, justincase will use it to determine\n    the location of its working directory, where it will try to load the configuration\n    file (the one you are reading right now).\n\n    If the configuration file is missing it will fallback to use the default settings,\n    that are the ones presented in the unmodified fresh version of the current file.\n */\n \n{\n  // What directories should be watched.\n  // Make sure the user running justincase has read permissions on them\n  \"watched_directories\" : [\"~/desktop\"],\n\n  // Whether is should monitor directories recursively\n  \"recursive_monitoring\" : true,\n\n\n  // A regexp to filter files names with\n  // \"filter_file_names_with_regexp\" : \"/aregexp/i\",\n\n\n  // Prevents hidden files to be backed up.\n  // If you do include them, they will still be subject to\n  // whitelisting and blacklisting logics\n  \"should_include_hidden_files\" : false,\n\n\n\n  // In case you want to limit the backups to some file types.\n  \"should_whitelist_file_extensions\" : false,\n\n  // Only works if \"should_whitelist_file_extensions:true\" is being used.\n  // Example: [\"txt\", \"log\", \"none!\"]\n  // \"none!\" indicates a file without extension.\n  // Enabling the whitelist and at the same time leaving this\n  // array empty will result in the exclusion of all file types.\n  \"file_extensions_whitelist\" : [],\n\n  // In case you want to exclude some file types.\n  // Takes precedence over file whitelisting.\n  \"should_blacklist_file_extensions\" : false,\n\n  // Only works if \"should_blacklist_file_extensions:true\" is being used.\n  // Example: [\"avi\", \"mkv\", \"mp4\", \"none!\"]\n  // \"none!\" indicates a file without extension\n  \"file_extensions_blacklist\" : [],\n\n\n\n  // Whether  justintime will run detached from the console.\n  // Set to false if you want more control.\n  \"daemonize\" : true,\n\n  // only works if \"daemonize:false\" is being used\n  \"verbose\" : true,\n\n\n  // log file system events\n  \"log_format\" : \"txt\",\n  // \"log_format\" : \"sqlite\",\n\n\n  // If you want actual logs\n  // Uses the default Ruby Logger:\n  // http://ruby-doc.org/stdlib-2.0/libdoc/logger/rdoc/Logger.html\n  // http://ruby-doc.org/stdlib-1.8.7/libdoc/logger/rdoc/Logger.html\n  \"debug_logging\" : false,\n\n  // A string to prepend to file names.\n  // In theory you *could* set this to an empty string, but doing so would\n  // have your OS take care of it in a way you can't control.\n  \"file_copy_prefix\" : \"timestamp\",\n  // \"file_copy_prefix\" : \"incremental_id\",\n\n  // A string to append to file names.\n  \"file_copy_suffix\" : \"\", //none\n  // \"file_copy_suffix\" : \"timestamp\",\n  // \"file_copy_suffix\" : \"incremental_id\",\n\n  // Only takes effect if \"timestamp\" is being used.\n  // Reference: http://ruby-doc.org/core-2.0/Time.html#method-i-strftime\n  // Default: 20130410-18:49:35+459-file_name.txt\n  // Curious fact: The ruby method call \"Time.now.strftime(template_str)\" will work\n  // with any random template string. Thus if you use, let's say, \"potato\", then\n  // \"potato\" will appear in your back up file names.\n  // I should probably fix this, but I think it's funny.\n  \"timestamp_template\" : \"%Y%m%d-%H:%M:$S+%L\",\n  //\"timestamp_template\" : \"a_monkey_was_here_at_%H:%M_on_%d-%m_and_liked_what_she_saw\",\n\n  // chmods backup files once copied.\n  // Please don't use the 4 digit format (the one with the setUID, setGID, StickyBit),\n  // as it's not supported yet.\n  \"chmod_files\" : false\n  //\"chmod_files\" : \"400\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftompave%2Fjustincase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftompave%2Fjustincase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftompave%2Fjustincase/lists"}