shawn14
April 23rd, 2014, 05:00 PM
I am used to windows and dos. now its time i learn a few new things about other operating systems
I am very new to linux unix ubuntu what ever. i am running on an old: inspiron 530s, 991.5 MiB RAM, Intel® Pentium(R) Dual CPU E2160 @ 1.80GHz × 2, Intel® G33 x86/MMX/SSE2, 32-bit OS, disk 77.6 GB.
I don't know the first thing about ubuntu and how to make a script auto start or what to expect from the native system.
I think I would need a step by step instruction on how to create a script. to maintain a directory. it can only get so full and old files can be deleted to maintain the directory. i am using 2 easyn ip cam's fs series and ftp into this machine stated above. i have it forwarding to the this ftp every second.
my ftp is pureftp server -- pureadmin v0.4 for gui
i made a directory in my home directory that the ftp puts the files.
/dadscam
in that directory is.
/cam1
/cam2
unless there is a program already out there i think i need a script.
thank you
i am still searching google. put don't see anything user friendly or step by step. sorry if i annoy you with this thread. i am very new to ubuntu.
the picture file names go something like this:
00A00107151A(IP\ Camera\ 2)_1_20140422200106_2852.jpg
file size are approximately 50.1kb
I am using approximately 8gb out of 66gb of hard drive from 6gb in the last 12 hrs
i think it would be wise to think about the size of the hard drive and the hours i can keep. eg. keep 24hr 48hr or 72hr etc.
i think i have more of a ram problem then a hard drive issue. i found this out by trying to access the cam1 directory threw the GUI. wow it stalled or lagged. but it seemed a lot easier access threw the terminal.
thank you for reading this far.
#!/bin/bash
# ip-cam-ftp-cleanup.sh
# _______ __ __ ________ _________
# / ___ \ | | | | | __ | /
# \ \ \_/ | | | | | | | | |
# \ \ | | / | | | | | |
# \ \ | |/ | | | | | | snowcatman
# \ \ | | | | | | |
# \ \ | /| | | | | | |
# _ \ \ | / | | | | | | |
# / \__/ / | | | | | |__| | |
# \______/ |__| |__| |________| \_____________
#
# ================================================== ==================
# modified script
#log this to a the local BASH file directory
# logger -s "foo bar" 2>> ~/bin/ip-cam-ftp-cleanup-log1.txt
# >>$ip-cam-ftp-cleanup-log2.txt 2>&1
#ip-cam-ftp-cleanup.sh >> ~/bin/ip-cam-ftp-cleanup-log3.txt 2>&1
#------------
#write_log()
#{
# while read text
# do
# LOGTIME=`date "+%Y-%m-%d %H:%M:%S"`
# # If log file is not defined, just echo the output
# if [ "$LOG_FILE" == "" ]; then
# echo $LOGTIME": $text";
# else
# LOG=$LOG_FILE.`date +%Y%m%d`
# touch $LOG
# if [ ! -f $LOG ]; then echo "ERROR!! Cannot create log file $LOG. Exiting."; exit 1; fi
# echo $LOGTIME": $text" | tee -a $LOG;
# fi
# done
#}
#------------
#need to add a indicator for how long the proccess might take.
# Show were trash can is.
TRASHCAN=~/.local/share/Trash/files
# Send to TrashCan
# find ~/dadscam/* -mtime +2 -exec mv {} $TRASHCAN \;
find ~/dadscam/* -mmin +2880 -exec mv {} $TRASHCAN \;
# Send to Death
# find $TRASHCAN* -mtime +3 -exec rm {} \;
find $TRASHCAN* -mmin +4320 -exec rm {} \;
# ================================================== ==================
#
# +-+-+-+-+-+-+-+
# |c|r|e|d|i|t|s|
# +-+-+-+-+-+-+-+
# http://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/
# My name is Shawn Quintal A.K.A. Online SnowCatMan
# snowcatman@gmail.com
# This is my first script.
# Using native to ubuntu 14.04
# This is a BASH script
# I got the examples from http://gotbletu.blogspot.com/ | http://www.youtube.com/user/gotbletu timebomb.sh
#
================================================== ==============================
i am looking to get the -mtime to hours if possible i thought i saw some were with a like 24h or something??? ok found it. still would like a program that can maintain a directory.
idk why the post was moved but ok.
i edited several times...
I am very new to linux unix ubuntu what ever. i am running on an old: inspiron 530s, 991.5 MiB RAM, Intel® Pentium(R) Dual CPU E2160 @ 1.80GHz × 2, Intel® G33 x86/MMX/SSE2, 32-bit OS, disk 77.6 GB.
I don't know the first thing about ubuntu and how to make a script auto start or what to expect from the native system.
I think I would need a step by step instruction on how to create a script. to maintain a directory. it can only get so full and old files can be deleted to maintain the directory. i am using 2 easyn ip cam's fs series and ftp into this machine stated above. i have it forwarding to the this ftp every second.
my ftp is pureftp server -- pureadmin v0.4 for gui
i made a directory in my home directory that the ftp puts the files.
/dadscam
in that directory is.
/cam1
/cam2
unless there is a program already out there i think i need a script.
thank you
i am still searching google. put don't see anything user friendly or step by step. sorry if i annoy you with this thread. i am very new to ubuntu.
the picture file names go something like this:
00A00107151A(IP\ Camera\ 2)_1_20140422200106_2852.jpg
file size are approximately 50.1kb
I am using approximately 8gb out of 66gb of hard drive from 6gb in the last 12 hrs
i think it would be wise to think about the size of the hard drive and the hours i can keep. eg. keep 24hr 48hr or 72hr etc.
i think i have more of a ram problem then a hard drive issue. i found this out by trying to access the cam1 directory threw the GUI. wow it stalled or lagged. but it seemed a lot easier access threw the terminal.
thank you for reading this far.
#!/bin/bash
# ip-cam-ftp-cleanup.sh
# _______ __ __ ________ _________
# / ___ \ | | | | | __ | /
# \ \ \_/ | | | | | | | | |
# \ \ | | / | | | | | |
# \ \ | |/ | | | | | | snowcatman
# \ \ | | | | | | |
# \ \ | /| | | | | | |
# _ \ \ | / | | | | | | |
# / \__/ / | | | | | |__| | |
# \______/ |__| |__| |________| \_____________
#
# ================================================== ==================
# modified script
#log this to a the local BASH file directory
# logger -s "foo bar" 2>> ~/bin/ip-cam-ftp-cleanup-log1.txt
# >>$ip-cam-ftp-cleanup-log2.txt 2>&1
#ip-cam-ftp-cleanup.sh >> ~/bin/ip-cam-ftp-cleanup-log3.txt 2>&1
#------------
#write_log()
#{
# while read text
# do
# LOGTIME=`date "+%Y-%m-%d %H:%M:%S"`
# # If log file is not defined, just echo the output
# if [ "$LOG_FILE" == "" ]; then
# echo $LOGTIME": $text";
# else
# LOG=$LOG_FILE.`date +%Y%m%d`
# touch $LOG
# if [ ! -f $LOG ]; then echo "ERROR!! Cannot create log file $LOG. Exiting."; exit 1; fi
# echo $LOGTIME": $text" | tee -a $LOG;
# fi
# done
#}
#------------
#need to add a indicator for how long the proccess might take.
# Show were trash can is.
TRASHCAN=~/.local/share/Trash/files
# Send to TrashCan
# find ~/dadscam/* -mtime +2 -exec mv {} $TRASHCAN \;
find ~/dadscam/* -mmin +2880 -exec mv {} $TRASHCAN \;
# Send to Death
# find $TRASHCAN* -mtime +3 -exec rm {} \;
find $TRASHCAN* -mmin +4320 -exec rm {} \;
# ================================================== ==================
#
# +-+-+-+-+-+-+-+
# |c|r|e|d|i|t|s|
# +-+-+-+-+-+-+-+
# http://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/
# My name is Shawn Quintal A.K.A. Online SnowCatMan
# snowcatman@gmail.com
# This is my first script.
# Using native to ubuntu 14.04
# This is a BASH script
# I got the examples from http://gotbletu.blogspot.com/ | http://www.youtube.com/user/gotbletu timebomb.sh
#
================================================== ==============================
i am looking to get the -mtime to hours if possible i thought i saw some were with a like 24h or something??? ok found it. still would like a program that can maintain a directory.
idk why the post was moved but ok.
i edited several times...