Quick Start¶
Using switchboard is pretty easy. Below lists the set of commands and flags you can pass in.
Run the switchboard application passing in the path, destination, and file type you'd like to watch for.
Usage:
watch [flags]
Flags:
--config string Pass an optional config file containing multiple paths to watch.
-d, --destination string Path you want files to be relocated.
-e, --ext string File type you want to watch for.
-h, --help help for watch
-p, --path string Path you want to watch.
--poll int Specify a polling time in seconds. (default 60)
Run the switchboard application passing in the path, destination, and file type you'd like to watch for.
Usage:
watch [flags]
Flags:
-k, --api-key string Pass a required product key to validate your pro package (PRO Only).
--config string Pass an optional config file containing multiple paths to watch.
-d, --destination string Path you want files to be relocated.
-e, --ext string File type you want to watch for.
-h, --help help for watch
--keep Pass an optional keep flag which will keep the original file in src path once moved(PRO Only).
-p, --path string Path you want to watch.
--poll int Specify a polling time in seconds. (default 60)
--post-process Pass an optional post-process flag which will unzip/unrar files found in a new event (PRO Only).
-r, --regex-pattern string Pass a regex pattern to watch for any files mathcing this pattern (PRO Only).
-v, --verbose Pass an optional verbose flag which will show debug messages for the watcher.
To get started quickly, you can run the following command, passing in the path, destination, and file extenstion you want to watch for. See the example below.
switchboard watch -p /home/user/Downloads -d /home/user/Movies -e .mp4
You can also use a config.yaml
file to make your time a little less cumbersome. Just follow the example tutorial here.
Info
We highly recommend using absolute file paths over relative file paths.
Always include the .
when passing the file extension to switchboard.
And that's it! Once ran, switchboard will start observing the user downloads folder every 60 seconds for mp4 files added. Once it receives a new create event with the correct file extension, it will move the file to the users movies folder.
Polling¶
Info
For Windows/MacOS We set a high polling time on switchboard as in some operating systems we don't get file closed notifications. Therefore switchboard implements a polling solutions to check for when a file was last written to. If the file falls outside the time since last polled, the file is assumed to be closed and will be moved to the destination directory.
Linux¶
For Linux
systems, as of release v1
we support IN_CLOSE_WRITE
events. This means we have set the default polling time to one second as a default, however the polling time is still configurable should you wish to change it.
Important Notes¶
Absolute File Path¶
As you might have noticed in the example above, we passed in the absolute file path. While relative file paths will work too, they have not been tested in all OS systems. Therefore we strongly recommend you use absolute file paths when running switchboard.
File Extenstion¶
You may have also noticed in the above example, we used .mp4
including the prefixed .
. This is important, as switchboard will not match file extenstions correctly if the given --ext
flag does not contain the .
.