DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-08-26 06:07:59

ameyer
Member
Registered: 2010-08-26
Posts: 10

Saving date in name of scheduled download?

I have my DNS 323 downloading a backup of one of my websites each night. The file is always named the same thing.

So every night, the previous backup is written over because of the same name.

Is there a way to dynamically change the save name so when it downloads it does not do write over the previous download?

Offline

 

#2 2010-08-26 10:13:28

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Saving date in name of scheduled download?

Code:

mv download.backup "`date`".backup

Offline

 

#3 2010-08-26 14:38:12

ameyer
Member
Registered: 2010-08-26
Posts: 10

Re: Saving date in name of scheduled download?

Thank you. Where does this go?

Mijzelf wrote:

Code:

mv download.backup "`date`".backup

Offline

 

#4 2010-08-26 15:39:53

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Saving date in name of scheduled download?

ameyer wrote:

Thank you. Where does this go?

Mijzelf wrote:

Code:

mv download.backup "`date`".backup

If you're using the built-in from-web-interface schedule download the answer is: It doesn't.
You can install fonz' fun plug and write scripts to do this pretty much whichever you'd like. But you'll, probably need to learn some linux skills.
Mijzelf's answer is a command you can issue to change your backup's name to the current date. But as I wrote, it'll require some work and linux know-how.


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#5 2010-08-26 16:42:41

ameyer
Member
Registered: 2010-08-26
Posts: 10

Re: Saving date in name of scheduled download?

Makes sense. I figured the download schedule would create a cron job, I was just hoping that I would be able to ssh into the device and just edit it.

Thanks.

Offline

 

#6 2010-08-26 23:03:39

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Saving date in name of scheduled download?

I haven't used that feature but what you write make sense. There is, however, a little caveat: All those settings are stored in NVRAM. At runtime, it's loaded into memory and resides in a RAMDISK. You can easily edit files on the RAMDISK, but after reboot you'll have to re-edit them.

If you install ffp. it's just as easy to create a script that adds a a cron job that does whatever you wish it to do.


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#7 2010-08-26 23:17:05

ameyer
Member
Registered: 2010-08-26
Posts: 10

Re: Saving date in name of scheduled download?

Awesome. Now if I could get it to take the fun_plug files I would be all set (RAID 1 so I have no volume2 to try )it just wont unpack them no matter ho much I restart.



scaramanga wrote:

I haven't used that feature but what you write make sense. There is, however, a little caveat: All those settings are stored in NVRAM. At runtime, it's loaded into memory and resides in a RAMDISK. You can easily edit files on the RAMDISK, but after reboot you'll have to re-edit them.

If you install ffp. it's just as easy to create a script that adds a a cron job that does whatever you wish it to do.

Offline

 

#8 2010-08-27 15:37:11

ameyer
Member
Registered: 2010-08-26
Posts: 10

Re: Saving date in name of scheduled download?

Got it all installed. And Im SSHing in!

So I created a script

Code:

#!/bin/bash
FILE=$1
NOW="`date +%b-%d-%y`"
cp $FILE "$NOW.$FILE"
echo "File $FILE == $NOW.$FILE"

but when I run it using ./script.sh file.txt I get -sh: ./renameToDate.sh: not found

I tested this same script locally and it works.

Any ideas?

Last edited by ameyer (2010-08-27 15:37:46)

Offline

 

#9 2010-08-27 15:41:59

ameyer
Member
Registered: 2010-08-26
Posts: 10

Re: Saving date in name of scheduled download?

Nevermind

No bash

Code:

#!/ffp/bin/sh
FILE=$1
NOW="`date +%b-%d-%y`"
mv $FILE "$NOW.$FILE"
echo "File $FILE == $NOW.$FILE"

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB