Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # Script to manage reknro files
- #--------------------------------------------------------------------------------1
- # 1.Download all new files to a temp directory
- # -nc = no clobber (skip existing files), -t = retries, -o = output log file, -P = target directory
- wget -nc -t 3 -o /home/viliny/reknro/reknrolog.log --user=USERNAME --password='PASSWORD' -P /home/viliny/reknro/temp/ ftp://000.000.000.000/Assistor/reknro*
- #--------------------------------------------------------------------------------2
- # 2. Move temp folder files to a datestamped directory
- # Create directory if it doesn't exist
- [ ! -d /home/viliny/reknro/$(date +"%m-%y") ] && mkdir -p /home/viliny/reknro/$(date +"%m-%y")
- # Move files to the directory
- mv /home/viliny/reknro/temp/* /home/viliny/reknro/$(date +"%m-%y")/
- #--------------------------------------------------------------------------------3
- # 3. Upload all new files to the remote archive
- pushd /home/viliny/reknro/$(date +"%m-%y")
- wput --skip-existing -t 3 reknro* ftp://USERNAME:PASSWORD@000.000.000.000/Assistor/downloaded
- popd
- #--------------------------------------------------------------------------------4
- # 4. Delete original files from server
- # NOT IN USE DURING TESTING
- #--------------------------------------------------------------------------------5
- # 5. Upload new files to inbox on server for processing into the system
- pushd /home/viliny/reknro/$(date +"%m-%y")
- wput --skip-existing -t 3 reknro* ftp://USERNAME:PASSWORD@000.000.000.000/AKEAssi/Reknro/
- popd
- #--------------------------------------------------------------------------------END
- # END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement