GithubHelp home page GithubHelp logo

begleysm / ipcam-ftp-tools Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 27 KB

This repository contains a collection of scripts useful in managing an FTP server that hosts uploaded images/videos from IP Cameras. The scripts are generic enough that they should be useful for other applications as well.

Shell 100.00%
tools ftp file filemanagement ipcam ipcamera

ipcam-ftp-tools's Introduction

ipcam-ftp-tools

Sean Begley ([email protected])

https://steamforge.net/wiki

https://github.com/begleysm/ipcam-ftp-tools

2019-11-19

This repository contains scripts I wrote for administering an FTP server that acts as a host for uploaded images/videos from IP Cameras. These scripts should also be useful in other applications.

bin-by-date

bin-by-date will recursivly copy or move "unsorted" files from a source directory to a destination directory where it will create a structure of "date" folders and in each "date" folder will be a set of "hour" folders. Each "hour" folder will contain all of the uploaded files, with specified extensions, from that "date"/"hour". The source folder can optionally be deleted afterwards.

  • first parameter $1 = path to source directory to be parsed /path/to/source/dir/
  • second paramter $2 = path to destination directory for files to be put in (sorted) /path/to/destination/dir/
  • third parameter $3 = comma delimited list of extensions to sort jpg,mp4
  • fourth parameter $4 = mode: copy or move or move-delete
    • if set to copy then files will be copied from the source dir to the destination dir and the source dir will be left unmodified
    • if set to move then files will be moved from the source dir to the destintion dir but any other files not moved will be left unmodified
    • if set to move-delete then files will be moved from the source dir to the destination dir and then all other files in the source dir will be deleted

example usage: ./bin-by-date /path/to/input/ /path/to/output/ jpg,mp4 move-delete

del-older-than

del-older-than will delete all files older than X number of days and will delete empty folders. I use it on bin-by-date's destination directory to ensure that I only keep a weeks worth of IP Camera images/videos.

  • first parameter $1 = path to directory to cleanup /path/to/dir
  • second parameter $2 = number of days of content to keep 14

example usage: ./del-older-than /path/to/parent/directory/ 14

del-not-ext

del-not-ext will delete files that don't end in an extension specified when calling the script. One of my IP Cameras will, sometimes, upload garabage filenames. Another one uploads .idx files I don't care about. I can run this script to delete those files before executing other operations.

  • first parameter $1 is the directory to work on /path/to/dir
  • second parameter $2 is a comma delimited list of file extensions to NOT delete jpg,mp4

example usage: ./del-not-ext /path/to/directory jpg,mp4

Note that this script was made somewhat obsolete by the combination of specified extensions and the move-delete mode of bin-by-date. I've left it intact because it might be useful in its own right.

ipcam-ftp-tools's People

Contributors

begleysm avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ipcam-ftp-tools's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.