<commit_before># `upsync`

An [`fswatch`](https://github.com/emcrisostomo/fswatch)-based `bash`-script that, based on a dot file `.upsync`
in a directory with the correct credentials, watches the directory for
changes and takes the specified upload action.

# Example
Given a directory 
```
/tmp/watched_dir/
├── .git
│   └── some_git_file
├── .upsync
├── ignored_dir
│   └── source_file_3.src
├── just_a_dir
│   └── source_file_2.src
└── source_file.src
```
and the contents of the .upsync file being
```
remote_user:root
remote_machine:dev.example.com
remote_directory:/tmp/watched_dir
remote_method:rsync -vrP
local_ignore: .git ignored_dir
```, we launch the upsync command thusly 
```
$ upsync watched_dir
```

This will watch any file not inside a directory listed in the
`local_ignore`-configuration variable and send it to the remote server
by issuing, under the supposition that the file
`/tmp/watched_dir/just_a_dir/source_file_2.src` was the one being
updated, the command

```
$ rsync -vrP /tmp/watched_dir/just_a_dir/source_file_2.src <EMAIL>:/tmp/watched_dir/just_a_dir/source_file_2.src
```
Example output:
```
$ upsync watched_dir/
++ Uploading file: /Users/fcar/tmp/watched_dir/just_a_dir/source_file_2.src
   rsync -vrP /Users/fcar/tmp/watched_dir/just_a_dir/source_file_2.src <EMAIL>:/tmp/watched_dir/just_a_dir/source_file_2.src<commit_msg>Typo fix.<commit_after># `upsync`

An [`fswatch`](https://github.com/emcrisostomo/fswatch)-based `bash`-script that, based on a dot file `.upsync`
in a directory with the correct credentials, watches the directory for
changes and takes the specified upload action.

# Example
Given a directory 
```
/tmp/watched_dir/
├── .git
│   └── some_git_file
├── .upsync
├── ignored_dir
│   └── source_file_3.src
├── just_a_dir
│   └── source_file_2.src
└── source_file.src
```
and the contents of the .upsync file being
```
remote_user:root
remote_machine:dev.example.com
remote_directory:/tmp/watched_dir
remote_method:rsync -vrP
local_ignore: .git ignored_dir
```
we launch the upsync command thusly 

```
$ upsync watched_dir
```

This will watch any file not inside a directory listed in the
`local_ignore`-configuration variable and send it to the remote server
by issuing, under the supposition that the file
`/tmp/watched_dir/just_a_dir/source_file_2.src` was the one being
updated, the command

```
$ rsync -vrP /tmp/watched_dir/just_a_dir/source_file_2.src <EMAIL>:/tmp/watched_dir/just_a_dir/source_file_2.src
```
Example output:
```
$ upsync watched_dir/
++ Uploading file: /Users/fcar/tmp/watched_dir/just_a_dir/source_file_2.src
   rsync -vrP /Users/fcar/tmp/watched_dir/just_a_dir/source_file_2.src <EMAIL>:/tmp/watched_dir/just_a_dir/source_file_2.src
{'fraction_non_alphanumeric': 0.11855670103092783, 'fraction_numerical': 0.005891016200294551, 'mean_word_length': 5.11936936936937, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '436372', 'n_tokens_mistral': 1017, 'n_tokens_neox': 998, 'n_words': 260}