LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-30-2015, 02:38 AM   #1
magische_vogel
Member
 
Registered: Jun 2009
Posts: 42

Rep: Reputation: 0
cURL -R option has no effect when downloading from google drive


I'm facing an issue when using the cURL R option.

Here is my cURL command:

Code:
curl -s -L -k -O -J -R "https://drive.google.com/uc?export=download&id=0B6LXSM_BRU4TbEE2ajlUOThXYlU"
The download process complete successfully but the file is created with the current datetime, i'm wondering why the -R option is not setting the remote file's time on the local file.

Trying with my webserver cURL -R option work correctly.I guess the problem occur only when google drive is used.

any help is appreciated

best regards.

magiche
 
Old 09-30-2015, 02:43 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
At first google created that file for you, that's why you got the current date and time. If you try it a bit later you will see the time will not change any more.
 
Old 09-30-2015, 02:54 AM   #3
magische_vogel
Member
 
Registered: Jun 2009
Posts: 42

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
At first google created that file for you, that's why you got the current date and time. If you try it a bit later you will see the time will not change any more.
Unfortunately each new downlaod operation append the cusrrent datetimestamp to the downloaded file. You can check that by your self by using the supplied link.By the way before commenting your answer i tried the link and i got the file in my embedded linux with the current timestamp.

Code:
root@dm800:~# curl -s -L -k -O -J -R "https://drive.google.com/uc?export=download&id=0B6LXSM_BRU4TbEE2ajlUOThXYlU"
root@dm800:~# ls -la e2*
-rw-r--r--    1 root     root       102748 Sep 30 09:47 e2-LISTE-DREAMBOX800HD-26.09.2015.tar.gz
best regards
 
Old 09-30-2015, 03:00 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
so that means it was always generated again and again.
 
Old 09-30-2015, 03:17 AM   #5
magische_vogel
Member
 
Registered: Jun 2009
Posts: 42

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
so that means it was always generated again and again.
I think yes.
As i'm planning to use the curl -z switch (time condition) to check the newer version of my files on google drive before each download request it is impossible to achieve this goal with such behavior of google drive.
As an alternative may be generating and gziping an md5 hash for each file will solve the probleme. What do you think about that ?

thanx
 
Old 09-30-2015, 03:27 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
yes, md5sum may help
 
  


Reply

Tags
curl, google drive



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When downloading a webpage by curl, what happen? postcd Linux - General 1 03-29-2014 02:50 PM
[SOLVED] curl not downloading full webpage BeaverusIV Programming 2 01-02-2012 06:04 AM
[SOLVED] curl -K command outputs weird symbols instead of downloading URL from file meridionaljet Linux - Newbie 7 05-16-2011 08:13 PM
RHEL5: includedir option in /etc/xinetd.conf does not take effect quanba Linux - Newbie 2 03-03-2010 03:37 AM
why the override-expire option is not effect ? jiawj Linux - Networking 0 04-11-2006 05:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration