Find Jobs
Hire Freelancers

462712 Linux script to move files

N/A

Ukończony
Opublikowano ponad 13 lat temu

N/A

Płatne przy odbiorze
Hello, I have a Linux server where I need a script that can do this. 1. At random times I have new files arriving (uploaded) into a folder /Share/[login to view URL] The files that arrive there are always three files then a fourth trigger file that is uploaded lastly ([login to view URL]) (that marks that the upload is complete). /Share/[login to view URL] /Share/[login to view URL] /Share/[login to view URL] /Share/[login to view URL] 2. Your script should scan this folder (/Share/[login to view URL]) and look for the file “[login to view URL]” • I plan to schedule (cron) your script to be run say each 5th minute and look inside this folder and see if the trigger file exists ([login to view URL]). • If trigger file exists your script should continue – otherwise abort. 3. Process new files – if [login to view URL] file is found • If the file “[login to view URL]” exists I want your script to continue and then to look inside this file: /Share/[login to view URL] Inside that file there is name of the format “DMDS-LNX-0001”. The name inside this file is random. Save this name into a variable. 4. Next your script should look inside the folder: /Share/[login to view URL] Scan all files with the names /Share/[login to view URL]*.id and see if the same variable name exists. If it exists I want these files to be removed: /Share/[login to view URL]%year-month-day-hour-minue-second%.id /Share/[login to view URL]%year-month-day-hour-minue-second%.mvg /Share/[login to view URL]%year-month-day-hour-minue-second%.rar All updates have three files and I want all these three files to be removed – so a duplicate update don't exists. There might be many files inside this folder – so your script should be able to process a lot of files. 5. Once files are removed you can move the new files from /Share/[login to view URL] to /Share/[login to view URL] • Files to move are those three new files: /Share/[login to view URL] /Share/[login to view URL] /Share/[login to view URL] But you can delete the [login to view URL] file (/Share/[login to view URL]) 6. Sometimes duplicate files wont exists then your script can just move the files from: /Share/[login to view URL] /Share/[login to view URL] /Share/[login to view URL] To: /Share/[login to view URL]%year-month-day-hour-minue-second%.id /Share/[login to view URL]%year-month-day-hour-minue-second%.mvg /Share/[login to view URL]%year-month-day-hour-minue-second%.rar 7. Sometimes whitespace exists within the files: /Share/[login to view URL] /Share/[login to view URL] You script should see to it that this whitespace is removed – before moving the files from /Share/[login to view URL] to /Share/[login to view URL] 8. I want your script to write to a log file on what it's doing. And I should be able to change some paths in the script if folder structure might change in the future. I prefer if the script is made with either PHP or Perl.
Identyfikator projektu: 2208607

Informację o projekcie

1 oferta
Zdalny projekt
Aktywny 12 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne
Przyznano:
Awatar Użytkownika
Please check PMB
$55 USD w 1 dzień
5,0 (108 opinii)
5,6
5,6

O kliencie

Flaga
Stockholm,
5,0
43
Członek od sty 17, 2007

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.