Can any one guide me how can i accomplish this by script
i continuously receive files via our ftp server into a certain folder is there a way i can take those files cat it to a new file by hour and create a new file when new hour starts?
Can any one guide me how can i accomplish this by script
i continuously receive files via our ftp server into a certain folder is there a way i can take those files cat it to a new file by hour and create a new file when new hour starts?
Put this in a script:
#!/bin/sh
## newfile.sh
/bin/cat /path/to/ftp_folder/* > /path/to/newfile_directory/newfile_`/bin/date +%Y-%m-%d_%H:%M`.txt
in crontab:
00 * * * * /home/youruser/bin/newfile.sh
this creates a new file everytime script runs i want to keep one file for each our
so file names are
07-18-11-13:18:50
07-18-11-13:23:04
so both files need to be written into the same file until the hour ends
Try:
#!/bin/sh
## newfile.sh
/bin/cat /path/to/ftp_folder/* > /path/to/newfile_directory/newfile.txt
/bin/cat /path/to/ftp_folder/* this is cating every single file
i wanna cat the files for that specific hour.